2007-09-24 Stepan Kasal * Makefile.am (version.c): New rule. * configure.ac: Do not instantiate version.c; remove the hack to keep version.c from being removed upon `make distclean'. diff --git a/Makefile.am b/Makefile.am index 5cc29bb..c91e0ce 100644 --- a/Makefile.am +++ b/Makefile.am @@ -177,6 +177,9 @@ awkgram.c: awkgram.y if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \ else :; fi +version.c: config.status version.in + $(SHELL) ./config.status --file=version.c:version.in + # This is for my development & testing. efence: gawk $(CC) $(LDFLAGS) -o gawk $$(ls *.o | grep -v '_p.o$$') $(LIBS) -lefence diff --git a/configure.ac b/configure.ac index dbc17d4..0236a6e 100644 --- a/configure.ac +++ b/configure.ac @@ -362,30 +362,6 @@ AC_CONFIG_FILES(Makefile awklib/Makefile doc/Makefile po/Makefile.in - test/Makefile - [version.c:version.in]) - -dnl This is a significant and rather ugly hack. We want to keep -dnl version.c from being removed upon `make distclean'. -dnl We put the `$$' on the front for old systems with 14-char filenames. - -dnl At this point, `configure' has finished creating `config.status' which -dnl actually does all the checking and configuring. `config.status' is run -dnl by the AC_OUTPUT macro below. This step comes in between the two: it -dnl adds code to `config.status'. Doing it there ensures that this step -dnl happens *every* time `config.status' is run, such as when `make' decides -dnl to update something. Fun, fun, fun. - -dnl Be careful of multiple levels of shell quoting! - -dnl The trailing newline in the sed command is needed for Mac OS X. Sigh. - -AC_CONFIG_COMMANDS_POST([sed '$i\ - echo $as_me: fixing Makefile to keep version.c\ - sed "/CONFIG_CLEAN_FILES/s/version.c//" < Makefile > $$.Makefile\ - mv $$.Makefile Makefile - ' < $CONFIG_STATUS > $$.gawk-hack - mv $$.gawk-hack $CONFIG_STATUS]) - + test/Makefile) AC_OUTPUT