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