chiark / gitweb /
fixes during movpos wip
[trains.git] / cprogs.make
index c9d0ebac109bd4e2ebf79c9da94db2b87919b3ec..00bf7e5040c673850466d17579f85afa8adbad8b 100644 (file)
@@ -1,6 +1,6 @@
 OPTIMISE= -O2
 WERROR= -Werror
-CFLAGS=        $(CPPFLAGS) \
+CFLAGS=        $(CPPFLAGS) -D_GNU_SOURCE \
        -Wall -Wwrite-strings -Wpointer-arith -Wmissing-declarations \
        -Wnested-externs -Wmissing-prototypes -Wstrict-prototypes \
        $(WERROR) \
@@ -8,6 +8,14 @@ CFLAGS=        $(CPPFLAGS) \
 CPPFLAGS=
 LINK=          $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+ $(LIBS)
 
-%.o:   %.c
-       $(CC) $(CFLAGS) -MM $< >$*.d
-       $(CC) $(CFLAGS) -o $@ -c $<
+LEX=flex
+BISON=bison
+
+FLEXCFLAGS=    -Wno-unused -Wno-missing-declarations -Wno-missing-prototypes
+
+%.o:   %.c $(AUTOINCS)
+       $(CC) $(CFLAGS) $(SPECIAL_CFLAGS_$*) -MM $< >$*.d
+       $(CC) $(CFLAGS) $(SPECIAL_CFLAGS_$*) -o $@ -c $<
+
+%.c:   %.y
+       $(BISON) -o $@ $<