From 48c151aa1683de94e42f4410fb9312936e030adf Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Sat, 7 May 2022 02:38:08 -0300 Subject: makefiles: deduplicate main target name into new PROG var Put the main target name into a new PROG variable, put PROG into a new TARGET variable, make "all" depend on `$(TARGET)` and replace every other occurrence of the main target name with `$(PROG)`. On the makefiles that build non-shared objects, to make them more similar. With this commit, all of their targets are identical (except for the extra "lib" target on src/lib/Makefile). --- src/firecfg/Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/firecfg/Makefile') diff --git a/src/firecfg/Makefile b/src/firecfg/Makefile index 2cc7495f5..31e84d864 100644 --- a/src/firecfg/Makefile +++ b/src/firecfg/Makefile @@ -1,6 +1,9 @@ ROOT = ../.. -include $(ROOT)/config.mk +PROG = firecfg +TARGET = $(PROG) + MOD_HDRS = \ ../include/common.h \ ../include/euid_common.h \ @@ -11,18 +14,18 @@ MOD_HDRS = \ MOD_OBJS = ../lib/common.o ../lib/firejail_user.o .PHONY: all -all: firecfg +all: $(TARGET) include $(ROOT)/src/common.mk %.o : %.c $(HDRS) $(ROOT)/config.mk $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@ -firecfg: $(OBJS) $(ROOT)/config.mk +$(PROG): $(OBJS) $(ROOT)/config.mk $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(EXTRA_LDFLAGS) .PHONY: clean -clean:; rm -fr *.o firecfg *.gcov *.gcda *.gcno *.plist +clean:; rm -fr *.o $(PROG) *.gcov *.gcda *.gcno *.plist .PHONY: distclean distclean: clean -- cgit v1.2.3-54-g00ecf