diff options
author | Kelvin M. Klann <kmk3.code@protonmail.com> | 2022-05-07 02:38:08 -0300 |
---|---|---|
committer | Kelvin M. Klann <kmk3.code@protonmail.com> | 2022-11-21 17:19:00 -0300 |
commit | 48c151aa1683de94e42f4410fb9312936e030adf (patch) | |
tree | 508b7b9cecb88856a8bcc5117248e923eedc031f /src/firecfg/Makefile | |
parent | makefiles: line-wrap MOD_HDRS and MOD_OBJS (diff) | |
download | firejail-48c151aa1683de94e42f4410fb9312936e030adf.tar.gz firejail-48c151aa1683de94e42f4410fb9312936e030adf.tar.zst firejail-48c151aa1683de94e42f4410fb9312936e030adf.zip |
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).
Diffstat (limited to 'src/firecfg/Makefile')
-rw-r--r-- | src/firecfg/Makefile | 9 |
1 files changed, 6 insertions, 3 deletions
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 @@ | |||
1 | ROOT = ../.. | 1 | ROOT = ../.. |
2 | -include $(ROOT)/config.mk | 2 | -include $(ROOT)/config.mk |
3 | 3 | ||
4 | PROG = firecfg | ||
5 | TARGET = $(PROG) | ||
6 | |||
4 | MOD_HDRS = \ | 7 | MOD_HDRS = \ |
5 | ../include/common.h \ | 8 | ../include/common.h \ |
6 | ../include/euid_common.h \ | 9 | ../include/euid_common.h \ |
@@ -11,18 +14,18 @@ MOD_HDRS = \ | |||
11 | MOD_OBJS = ../lib/common.o ../lib/firejail_user.o | 14 | MOD_OBJS = ../lib/common.o ../lib/firejail_user.o |
12 | 15 | ||
13 | .PHONY: all | 16 | .PHONY: all |
14 | all: firecfg | 17 | all: $(TARGET) |
15 | 18 | ||
16 | include $(ROOT)/src/common.mk | 19 | include $(ROOT)/src/common.mk |
17 | 20 | ||
18 | %.o : %.c $(HDRS) $(ROOT)/config.mk | 21 | %.o : %.c $(HDRS) $(ROOT)/config.mk |
19 | $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@ | 22 | $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@ |
20 | 23 | ||
21 | firecfg: $(OBJS) $(ROOT)/config.mk | 24 | $(PROG): $(OBJS) $(ROOT)/config.mk |
22 | $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(EXTRA_LDFLAGS) | 25 | $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(EXTRA_LDFLAGS) |
23 | 26 | ||
24 | .PHONY: clean | 27 | .PHONY: clean |
25 | clean:; rm -fr *.o firecfg *.gcov *.gcda *.gcno *.plist | 28 | clean:; rm -fr *.o $(PROG) *.gcov *.gcda *.gcno *.plist |
26 | 29 | ||
27 | .PHONY: distclean | 30 | .PHONY: distclean |
28 | distclean: clean | 31 | distclean: clean |