diff --git a/GNUmakefile b/GNUmakefile index 54f437a..a2a1624 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -242,7 +242,6 @@ all: version config $(TARGET) version: @echo "$(PNAME) $(VERSION)" - @touch version.c config: @echo "via pkg-config: $(strip $(PKGS) $(TPKGS))" @@ -260,9 +259,11 @@ endif $(TARGET): $(OBJS) $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) -%.o: %.c $(HDRS) GNUmakefile $(VFILE) +%.o: %.c $(HDRS) GNUmakefile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< +version.o: version.c version.h GNUmakefile $(VFILE) FORCE + extra/pki/rsa.pem: $(MAKE) -C extra/pki @@ -274,13 +275,10 @@ test: extra/pki/rsa.pem $(TARGET).test $(TARGET).test: $(TOBJS) $(CC) $(LDFLAGS) $(TPKG_LDFLAGS) -o $@ $^ $(LIBS) $(TPKG_LIBS) -%.ot: %.t $(HDRS) GNUmakefile $(VFILE) +%.ot: %.t $(HDRS) GNUmakefile $(CC) -c $(CPPFLAGS) $(TPKG_CPPFLAGS) $(CFLAGS) $(TPKG_CFLAGS) -o $@ \ -x c $< -lint: - $(CPPCHECK) --force --enable=all --error-exitcode=1 . - clean: $(RM) -f $(TARGET) *.o $(TARGET).test *.ot *.core *~ $(RM) -rf *.dSYM @@ -296,6 +294,9 @@ deinstall: $(RM) -f $(PREFIX)/bin/$(TARGET) $(PREFIX)/share/man/man1/$(TARGET).1 ifdef GITDIR +lint: + $(CPPCHECK) --force --enable=all --error-exitcode=1 . + mantest: $(RM) -f man1 $(LN) -sf . man1 @@ -340,6 +341,8 @@ realclean: distclean manclean clean $(MAKE) -C extra/pki clean endif +FORCE: + .PHONY: all config clean test lint install deinstall \ mantest man manclean fetchdeps dist disttest distclean realclean diff --git a/main.t b/main.t index db23529..18f0192 100644 --- a/main.t +++ b/main.t @@ -28,6 +28,7 @@ #include "attrib.h" #include "opts.h" +#include "version.h" #include #include @@ -43,11 +44,9 @@ blank_suite(void) START_TEST(build_date_01) { - char *bd = BUILD_DATE; - - fail_unless(strlen(bd) == 10, "length mismatch"); - fail_unless(bd[4] == '-', "year/month separator not dash"); - fail_unless(bd[7] == '-', "month/day separator not dash"); + fail_unless(strlen(build_date) == 10, "length mismatch"); + fail_unless(build_date[4] == '-', "year/month separator not dash"); + fail_unless(build_date[7] == '-', "month/day separator not dash"); } END_TEST