add a git reset to rebuild
[fillybot.git] / Makefile
blobe1b5e84397e604c3949a155f53ca1549df7c2ade
1 all: fillybot mod.so
3 CFLAGS ?= -Wall -Wno-pointer-sign -g -O0 `pkg-config libxml-2.0 --cflags` -Werror -std=gnu99
4 LDFLAGS ?= -lssl -lbfd -ldl -Wl,-rpath=`pwd`
5 OBJS := main.o crash.o backtrace-symbols.o
6 MODS := mod.O entities.O
7 MOD_LDFLAGS ?= -lcurl `pkg-config libxml-2.0 --libs` -lmagic -ltdb
9 LIBRARY_DEFINES =
11 SHARED_HEADERS = shared.h owner.h
12 MOD_HEADERS = $(SHARED_HEADERS) entities.h mod.h
13 CORE_HEADERS = $(SHARED_HEADERS) mod.h core.h
15 owner.h: Makefile
16 @echo "static char owner[] = \"`whoami`\";" > owner.h
18 local.c:
19 touch local.c
21 %.o: %.c $(CORE_HEADERS)
22 @echo CC $<
23 @$(CC) -c $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@
25 %.o: %.cpp $(CORE_HEADERS)
26 @echo CXX $<
27 @$(CXX) -c $(INCLUDES) $(CXXFLAGS) $(LIBRARY_DEFINES) $< -o $@
29 %.O: %.c $(MOD_HEADERS)
30 @echo CC $<
31 @$(CC) -c $(INCLUDES) $(CFLAGS) -fPIC $(LIBRARY_DEFINES) $< -o $@
33 mod.O:: local.c
35 fillybot: $(OBJS)
36 @echo LD $@
37 @$(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $@
39 mod.so: $(MODS)
40 @echo LD $@
41 @$(CC) $(CFLAGS) -fPIC -shared $(MODS) $(MOD_LDFLAGS) -o $@
43 clean:
44 rm -f fillybot mod.so *.o *.O *~ owner.h