etc-cleanup: fix wrong header path in Makefile

This is causing main.o to be built using an implicit rule (rather than
the rule from src/prog.mk), which does not use PROG_CFLAGS.  Example
(using src/fldd as a working example for comparison):

    $ make -C src/etc-cleanup clean >/dev/null &&
      make -C src/etc-cleanup | grep -Ev '(Entering|Leaving) directory'
    gcc -g -O2   -c -o main.o main.c
    gcc -pie -fPIE -Wl,-z,relro -Wl,-z,now   -o etc-cleanup main.o
    $ make -C src/etc-cleanup clean >/dev/null &&
      make -C src/etc-cleanup -r | grep -Ev '(Entering|Leaving) directory'
    make: *** No rule to make target 'main.o', needed by 'etc-cleanup'.  Stop.

    $ make -C src/fldd clean >/dev/null &&
      make -C src/fldd | grep -Ev '(Entering|Leaving) directory'
    gcc -ggdb  -O2 -DVERSION='"0.9.73"' -fstack-protector-all [...]
    gcc -pie -fPIE -Wl,-z,relro -Wl,-z,now   -o fldd main.o ../lib/common.o ../lib/ldd_utils.o
    $ make -C src/fldd clean >/dev/null &&
      make -C src/fldd -r | grep -Ev '(Entering|Leaving) directory'
    gcc -ggdb  -O2 -DVERSION='"0.9.73"' -fstack-protector-all [...]
    gcc -pie -fPIE -Wl,-z,relro -Wl,-z,now   -o fldd main.o ../lib/common.o ../lib/ldd_utils.o

Environment: GNU make 4.4.1-2 on Artix Linux.

This amends commit e889db095 ("build fix", 2023-02-06).

See also commit 02d37680c ("private-etc rework: file groups moved to
src/include/etc_groups.h, new groups added", 2023-01-25).

Relates to #5610.
This commit is contained in:
Kelvin M. Klann 2023-05-11 22:35:06 -03:00
parent 06816e9045
commit 020ae580b6

View file

@ -4,6 +4,6 @@ ROOT = ../..
PROG = etc-cleanup
TARGET = $(PROG)
MOD_HDRS = ../include/etc-groups.h
MOD_HDRS = ../include/etc_groups.h
include $(ROOT)/src/prog.mk