chiark / gitweb /
show debugp in debug section
[trains.git] / cprogs.make
index 5ef8b5065385da220eee525a39b8b03386dc06a9..e6fd70cd360aad6f777278cd628809ad5b1ec8cd 100644 (file)
@@ -1,4 +1,13 @@
 OPTIMISE= -O2
-CFLAGS=        -Wall -Wwrite-strings -Wpointer-arith \
+WERROR= -Werror
+CFLAGS=        $(CPPFLAGS) -D_GNU_SOURCE \
+       -Wall -Wwrite-strings -Wpointer-arith -Wmissing-declarations \
        -Wnested-externs -Wmissing-prototypes -Wstrict-prototypes \
+       $(WERROR) \
        -g $(OPTIMISE)
+CPPFLAGS=
+LINK=          $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+ $(LIBS)
+
+%.o:   %.c $(AUTOINCS)
+       $(CC) $(CFLAGS) -MM $< >$*.d
+       $(CC) $(CFLAGS) -o $@ -c $<