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