aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2022-05-06 23:09:18 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2022-11-20 17:13:29 -0300
commit289346ef863626f917bd3345912ed55fdd09cd40 (patch)
treec4e1f1a123caf1049e04cc99a06ffa4910a7e80c /src/lib
parentmakefiles: remove unused BINOBJS variable (diff)
downloadfirejail-289346ef863626f917bd3345912ed55fdd09cd40.tar.gz
firejail-289346ef863626f917bd3345912ed55fdd09cd40.tar.zst
firejail-289346ef863626f917bd3345912ed55fdd09cd40.zip
lib/Makefile: put all target before include of common.mk
The "all" target is usually intended to be the default one and when running make, the first target on a makefile is the one that gets built if no target is specified (such as when running `make` with no arguments). Also, note that unlike config.mk, src/common.mk may define its own targets, so move the "all" target to before the include of src/common.mk, to ensure that "all" keeps being the default target regardless of what is defined in src/common.mk. Note: If the "all" target is defined as depending directly on `$(OBJS)` while it is empty (that is, before src/common.mk is included), running `make` (or `make all`) will result in make always concluding that there is nothing to be done and exiting. So make "all" depend on an intermediary phony "lib" target instead, which in turn depends on `$(OBJS)` (and is declared after `$(OBJS)` is populated).
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Makefile7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/Makefile b/src/lib/Makefile
index d9bc63ef7..7cfd38f10 100644
--- a/src/lib/Makefile
+++ b/src/lib/Makefile
@@ -1,8 +1,11 @@
1.PHONY: all
2all: lib
3
1ROOT = ../.. 4ROOT = ../..
2include $(ROOT)/src/common.mk 5include $(ROOT)/src/common.mk
3 6
4.PHONY: all 7.PHONY: lib
5all: $(OBJS) 8lib: $(OBJS)
6 9
7%.o : %.c $(H_FILE_LIST) $(ROOT)/config.mk 10%.o : %.c $(H_FILE_LIST) $(ROOT)/config.mk
8 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@ 11 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@