chiark / gitweb /
fix grammar in a comment
[trains.git] / cprogs.make
index bdda24434e016dd70a992eed64e127d44b04b13f..ab853bad6d8987b04140042c548ab56c67ac06e5 100644 (file)
@@ -1,3 +1,20 @@
-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)
+
+LEX=flex
+BISON=bison
+
+FLEXCFLAGS=    -Wno-unused -Wno-missing-declarations -Wno-missing-prototypes
+
+%.o:   %.c $(AUTOINCS)
+       $(CC) $(CFLAGS) $(SPECIAL_CFLAGS_$*) -MMD -o $@ -c $<
+
+%.c:   %.y
+       $(BISON) -o $@ $<