chiark / gitweb /
hostside: hidrawconv: rename various variables and functions to be more sensible...
[trains.git] / cprogs.make
index 06f15fc4ba6d2a300068a025696618c2442a14b8..22ec57067f54c46f2edc6d0ce495c7ec1d7b2c0a 100644 (file)
@@ -1,6 +1,25 @@
 OPTIMISE= -O2
 WERROR= -Werror
-CFLAGS=        -Wall -Wwrite-strings -Wpointer-arith \
+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)
+
+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 $@ $<
+
+ETAGS_SRCS += $(wildcard *.[ch])
+
+TAGS:  $(ETAGS_SRCS)
+       etags $^