diff --git a/Bot/Makefile b/Bot/Makefile index f5e0335..ceff889 100644 --- a/Bot/Makefile +++ b/Bot/Makefile @@ -5,7 +5,7 @@ include $(PWD)/Platform/$(PLATFORM).mk .PHONY: all clean .SUFFIXES: .c .o -OBJS = main.o util.o db.o bot.o ircfw.o +OBJS = main.o util.o db.o bot.o ircfw.o ../Web/web.a all: ircarc$(EXEC) @@ -13,7 +13,7 @@ ircarc$(EXEC): $(OBJS) $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) .c.o: - $(CC) $(CFLAGS) -c -o $@ $< + $(CC) $(CFLAGS) -I $(PWD)/Web -c -o $@ $< clean: rm -f *.o *.exe ircarc diff --git a/Makefile b/Makefile index 5eb917f..d1bb672 100644 --- a/Makefile +++ b/Makefile @@ -5,15 +5,19 @@ PLATFORM = generic FLAGS = PWD=$(PWD) PLATFORM=$(PLATFORM) -.PHONY: all format clean ./Bot +.PHONY: all format clean ./Bot ./Web all: ./Bot -./Bot:: +./Bot:: ./Web + $(MAKE) -C $@ $(FLAGS) + +./Web:: $(MAKE) -C $@ $(FLAGS) format: clang-format --verbose -i `find . -name "*.c" -or -name "*.h"` clean: - $(MAKE) -C $@ $(FLAGS) clean + $(MAKE) -C ./Bot $(FLAGS) clean + $(MAKE) -C ./Web $(FLAGS) clean diff --git a/Platform/generic.mk b/Platform/generic.mk index aba6e19..b07a1e2 100644 --- a/Platform/generic.mk +++ b/Platform/generic.mk @@ -1,6 +1,7 @@ # $Id$ CC = cc +AR = ar CFLAGS = -std=c99 LDFLAGS = LIBS = -lsqlite3 diff --git a/Web/Makefile b/Web/Makefile new file mode 100644 index 0000000..28edfbb --- /dev/null +++ b/Web/Makefile @@ -0,0 +1,19 @@ +# $Id$ + +include $(PWD)/Platform/$(PLATFORM).mk + +.PHONY: all clean +.SUFFIXES: .c .o + +OBJS = db.o + +all: web.a + +web.a: $(OBJS) + $(AR) rcs $@ $(OBJS) + +.c.o: + $(CC) $(CFLAGS) -c -o $@ $< + +clean: + rm -f *.a *.o diff --git a/Web/db.c b/Web/db.c new file mode 100644 index 0000000..a0749a0 --- /dev/null +++ b/Web/db.c @@ -0,0 +1 @@ +/* $Id$ */