]> git.ipfire.org Git - ipfire-2.x.git/blob - src/fake-environ/Makefile
Merge remote-tracking branch 'origin/next' into thirteen
[ipfire-2.x.git] / src / fake-environ / Makefile
1
2 ifeq "$(CFLAGS)" ""
3 $(error CLFAGS not defined.)
4 endif
5
6 ifeq "$(TOOLS_DIR)" ""
7 $(error TOOLS_DIR not defined.)
8 endif
9
10 LIB = libpakfire_preload.so
11
12 SOURCES = $(wildcard *.c)
13 OBJECTS = $(patsubst %.c,%.o,$(SOURCES))
14
15 .PHONY: all
16 all: $(LIB)
17
18 %.o: %.c Makefile
19 $(CC) $(CFLAGS) -o $@ -c $<
20
21 $(LIB): $(OBJECTS)
22 $(CC) $(CFLAGS) -shared -o $@ $? -ldl -static-libgcc
23
24 .PHONY: install
25 install: all
26 -mkdir -pv $(TOOLS_DIR)/lib/
27 install -p -m 755 $(LIB) $(TOOLS_DIR)/lib
28
29 .PHONY: clean
30 clean:
31 $(LIB)