diff options
author | 2022-05-07 02:38:08 -0300 | |
---|---|---|
committer | 2022-11-21 17:19:00 -0300 | |
commit | 48c151aa1683de94e42f4410fb9312936e030adf (patch) | |
tree | 508b7b9cecb88856a8bcc5117248e923eedc031f /src/fbuilder | |
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/fbuilder')
-rw-r--r-- | src/fbuilder/Makefile | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/fbuilder/Makefile b/src/fbuilder/Makefile index a7ff45176..5b9356da4 100644 --- a/src/fbuilder/Makefile +++ b/src/fbuilder/Makefile | |||
@@ -1,21 +1,24 @@ | |||
1 | ROOT = ../.. | 1 | ROOT = ../.. |
2 | -include $(ROOT)/config.mk | 2 | -include $(ROOT)/config.mk |
3 | 3 | ||
4 | PROG = fbuilder | ||
5 | TARGET = $(PROG) | ||
6 | |||
4 | MOD_HDRS = ../include/common.h ../include/syscall.h | 7 | MOD_HDRS = ../include/common.h ../include/syscall.h |
5 | 8 | ||
6 | .PHONY: all | 9 | .PHONY: all |
7 | all: fbuilder | 10 | all: $(TARGET) |
8 | 11 | ||
9 | include $(ROOT)/src/common.mk | 12 | include $(ROOT)/src/common.mk |
10 | 13 | ||
11 | %.o : %.c $(HDRS) $(ROOT)/config.mk | 14 | %.o : %.c $(HDRS) $(ROOT)/config.mk |
12 | $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@ | 15 | $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@ |
13 | 16 | ||
14 | fbuilder: $(OBJS) $(ROOT)/config.mk | 17 | $(PROG): $(OBJS) $(ROOT)/config.mk |
15 | $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(EXTRA_LDFLAGS) | 18 | $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(EXTRA_LDFLAGS) |
16 | 19 | ||
17 | .PHONY: clean | 20 | .PHONY: clean |
18 | clean:; rm -fr *.o fbuilder *.gcov *.gcda *.gcno *.plist | 21 | clean:; rm -fr *.o $(PROG) *.gcov *.gcda *.gcno *.plist |
19 | 22 | ||
20 | .PHONY: distclean | 23 | .PHONY: distclean |
21 | distclean: clean | 24 | distclean: clean |