split template code out into template.c
[tridge/junkcode.git] / tserver / Makefile
index 9e54512561f0c41b85aaa9c9bbb2c2e10c3679a9..e0a7a1e3aaf0194daf1cd8e92c81e05195cd90e6 100644 (file)
@@ -1,9 +1,18 @@
-CFLAGS=-Wall -O2 -D_GNU_SOURCE=1
-OBJS = util.o tserver.o cgi.o
+CC=gcc
+CFLAGS=-O6 -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align
+CPPFLAGS=-D_GNU_SOURCE=1
+OBJS = util.o tserver.o cgi.o template.o
+LIBS =
+INCLUDES = includes.h cgi.h template.h
+
+%.o: %.c $(INCLUDES)
+       @echo Compiling $*.c
+       @$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c 
 
 tserver: $(OBJS)
-       $(CC) $(CFLAGS) -o tserver $(OBJS)
-       strip tserver
+       @echo Linking $@
+       @$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
+       @strip $@
 
 clean:
        /bin/rm -f *.o tserver *~