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