# Use -DHACKY_PARALLEL if you are compiling secnet for an extremely
# slow machine
#CFLAGS:=-Wall @WRITESTRINGS@ @CFLAGS@ -DHACKY_PARALLEL
-CFLAGS:=-Wall @WRITESTRINGS@ @CFLAGS@
+CFLAGS:=-Wall @WRITESTRINGS@ @CFLAGS@ \
+ -W -Wno-unused \
+ -Wno-pointer-sign -Wstrict-prototypes -Wmissing-prototypes \
+ -Wmissing-declarations -Wnested-externs -Wredundant-decls \
+ -Wpointer-arith -Wformat=2 -Winit-self \
+ -Wswitch-enum -Wunused-variable -Wbad-function-cast
ALL_CFLAGS:=@DEFS@ -I$(srcdir) -I. $(CFLAGS)
CPPFLAGS:=@CPPFLAGS@
LDFLAGS:=@LDFLAGS@
%.c: %.y
%.yy.c: %.fl
- flex -o$@ $<
+ flex --header=$*.yy.h -o$@ $<
%.tab.c %.tab.h: %.y
bison -d -o $@ $<
# Manual dependencies section
conffile.yy.c: conffile.fl conffile.tab.c
+conffile.yy.h: conffile.yy.c
conffile.tab.c: conffile.y
# End of manual dependencies section
$(CC) $(LDFLAGS) $(ALL_CFLAGS) -o $@ $(OBJECTS) $(LDLIBS)
version.c: Makefile
- echo "char version[]=\"secnet $(VERSION)\";" >version.c
+ echo "#include \"secnet.h\"" >$@.new
+ echo "char version[]=\"secnet $(VERSION)\";" >>$@.new
+ mv -f $@.new $@
install: all
$(INSTALL) -d $(prefix)/share/secnet $(sbindir)
clean:
$(RM) -f *.o *.yy.c *.tab.[ch] $(TARGETS) core version.c
+ $(RM) -f *.d *~
realclean: clean
$(RM) -f *~ Makefile config.h *.d \