From 00d1bf659506cf9a899b35994e3d7a00ed3c58f6 Mon Sep 17 00:00:00 2001 From: Keith Marshall Date: Wed, 29 May 2013 22:07:07 +0100 Subject: [PATCH] Autoconfiscate. --- .hgignore | 4 ++ ChangeLog | 8 +++ Makefile | 42 ---------------- Makefile.in | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 41 +++++++++++++++ 5 files changed, 212 insertions(+), 42 deletions(-) delete mode 100644 Makefile create mode 100644 Makefile.in create mode 100644 configure.ac diff --git a/.hgignore b/.hgignore index 86541d1..0c7672a 100644 --- a/.hgignore +++ b/.hgignore @@ -1,6 +1,10 @@ syntax: glob *.o *.exe +build/ +Makefile +configure +autom4te.cache/ pexports hparse.[ch] hlex.c diff --git a/ChangeLog b/ChangeLog index af2f9bf..85eceb5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2013-05-29 Keith Marshall + Autoconfiscate. + + * configure.ac Makefile.in: New files. + * Makefile: Now auto-generated at configure time; remove it. + * .hgignore: Add configure, Makefile, autom4te.cache and build dir. + +2013-05-29 Keith Marshall + Integrate build-aux utilities as a submodule. * .gitmodules .hgsub .hgsubstate: New files. diff --git a/Makefile b/Makefile deleted file mode 100644 index 4f54e2e..0000000 --- a/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -CC=gcc -Wall -LEX=flex -YACC=bison -PACKAGE_VERSION=0.45 -PACKAGE_NAME=pexports -EXEEXT=.exe -O=o - -DISTFILES=AUTHORS README COPYING ChangeLog \ - Makefile hlex.l hparse.y pexports.h \ - pexports.c str_tree.c str_tree.h - -OBJS=hlex.$(O) hparse.$(O) pexports.$(O) str_tree.$(O) - -all: pexports$(EXEEXT) - -pexports$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) - -pexports.$(O): pexports.c pexports.h str_tree.h -str_tree.$(O): str_tree.c str_tree.h -hlex.$(O): hlex.c hparse.h -hlex.c: hlex.l -hparse.$(O): hparse.c str_tree.h -hparse.h: hparse.c -hparse.c: hparse.y - bison -d $< -o $@ - -dist: $(DISTFILES) - mkdir -p /tmp/$(PACKAGE_NAME)-$(PACKAGE_VERSION) - cp -p $(DISTFILES) /tmp/$(PACKAGE_NAME)-$(PACKAGE_VERSION)/ - cd /tmp && tar -chof - $(PACKAGE_NAME)-$(PACKAGE_VERSION) | xz --format=lzma >\ - $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.lzma - mv /tmp/$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.lzma . - rm -rf /tmp/$(PACKAGE_NAME)-$(PACKAGE_VERSION) - -clean: - $(RM) -f *.o pexports$(EXEEXT) hlex.c hparse.c hparse.h - -realclean: clean - $(RM) -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.lzma - diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..1e94fe9 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,159 @@ +# @configure_input@ +# +# Makefile.in for pexports +# Created 2013-05-29 by Keith Marshall +# Copyright (C) 2013, MinGW.org Project. +# +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ + +# Host identification is included in names of distributed tarballs. +# +host_os = @host_os@ + +# Directory configuration. +# +VPATH = @srcdir@ +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ + +# Compiler identification. +# +CC = @CC@ +CPPFLAGS = @CPPFLAGS@ +CFLAGS = @CFLAGS@ +LDFLAGS = @LDFLAGS@ + +# Output file extensions. +# +OBJEXT = @OBJEXT@ +EXEEXT = @EXEEXT@ + +# Lexical analyser. +# +LEX = @LEX@ +LFLAGS = @LFLAGS@ + +# Parser generator. +# +YACC = @YACC@ +YFLAGS = @YFLAGS@ + +# Miscellaneous utility commands. +# +RM = rm -f +MKDIR_P = @MKDIR_P@ +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +LN_S = @LN_S@ + +# Files to be included in a source tarball. +# +SRC_DISTFILES = \ + AUTHORS README COPYING ChangeLog configure.ac configure \ + Makefile.in hlex.l hlex.c hparse.y hparse.c hparse.h pexports.h \ + pexports.c str_tree.c str_tree.h + +AUX_DISTFILES = \ + config.guess config.sub install-sh + +# Files to be included in a binary tarball. +# +BIN_DISTFILES = pexports$(EXEEXT) + +OBJECT_FILES = \ + hlex.$(OBJEXT) hparse.$(OBJEXT) pexports.$(OBJEXT) str_tree.$(OBJEXT) + +# Default build rule. +# +all: $(BIN_DISTFILES) + +# Configuration management. +# +configure: configure.ac + cd @top_srcdir@; autoconf + +config.status: configure + ./config.status --recheck + +Makefile: config.status Makefile.in + ./config.status + +pexports$(EXEEXT): $(OBJECT_FILES) + $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $^ $(LIBS) + +# Binary file build rules and dependency tracking. +# +INCLUDES = -I ${srcdir} +CDEPFLAGS = -MMD -MP -MF $*.dep $(CPPFLAGS) +sinclude *.dep + +%.$(OBJEXT): %.c + $(CC) $(CDEPFLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $< + +%.c: %.y + $(YACC) $(YFLAGS) -o $@ $< + +hlex.$(OBJEXT): hlex.c hparse.h +hparse.h: hparse.c + +# Installation rules. +# +install: all + $(MKDIR_P) ${bindir} + $(INSTALL_PROGRAM) $(BIN_DISTFILES) ${bindir} + +install-strip: + $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install + +uninstall: + for file in $(BIN_DISTFILES); \ + do $(RM) ${bindir}/$$file; \ + done + +# Distribution. +# +dist: srcdist bindist + +abs_top_srcdir = @abs_top_srcdir@ + +PACKAGE_DISTNAME = $(PACKAGE_DISTVERSION)-$(host_os) +PACKAGE_DISTVERSION = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION) + +srcdist: $(SRC_DISTFILES) + $(RM) -r tmp + $(MKDIR_P) tmp/$(PACKAGE_DISTVERSION) + cd tmp/$(PACKAGE_DISTVERSION) && \ + for file in $(SRC_DISTFILES); \ + do test -f ../../$$file && $(LN_S) ../../$$file . \ + || $(LN_S) ${abs_top_srcdir}/$$file .; \ + done + $(MKDIR_P) tmp/$(PACKAGE_DISTVERSION)/build-aux + cd tmp/$(PACKAGE_DISTVERSION)/build-aux && \ + for file in $(AUX_DISTFILES); \ + do $(LN_S) ${abs_top_srcdir}/build-aux/$$file .; \ + done + cd tmp && tar -chof - $(PACKAGE_DISTVERSION) \ + | xz > ../$(PACKAGE_DISTNAME)-src.tar.xz + $(RM) -r tmp + +bindist: $(BIN_DISTFILES) + $(RM) -r tmp + $(MAKE) prefix=`pwd`/tmp install + cd tmp && tar -chof - bin | xz > ../$(PACKAGE_DISTNAME)-bin.tar.xz + $(RM) -r tmp + +# Clean-up. +# +mostlyclean clean: + $(RM) *.dep *.$(OBJEXT) $(BIN_DISTFILES) + +distclean realclean: clean + $(RM) $(PACKAGE_DISTNAME)-*.tar.* config.status config.log + +maintainer-clean: distclean + $(RM) hlex.c hparse.c hparse.h + +# Makefile.in: end of file diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..cf211ce --- /dev/null +++ b/configure.ac @@ -0,0 +1,41 @@ +# configure.ac for pexports +# Created 2013-05-29 by Keith Marshall +# Copyright (C) 2013, MinGW.org Project. +# + AC_INIT([pexports],[0.46],[http://mingw.org/reporting_bugs]) +# +# Directory organisation. +# + AC_CONFIG_SRCDIR([pexports.c]) + AC_CONFIG_AUX_DIR([build-aux]) +# +# We use the host_os component of the canonical triplet as an identifier +# in generated package names. +# + AC_CANONICAL_HOST +# +# Identify the compiler, lexical analyser, and parser generator. +# + AC_PROG_CC + AC_PROG_LEX + AC_PROG_YACC +# +# Initialise flags for the lexical analyser, and the parser generator. +# FIXME: these YFLAGS gratuitously assume that the parser generator will +# be GNU bison; we may need to adjust for yacc or byacc. +# + AC_SUBST([LFLAGS]) + AC_SUBST([YFLAGS],[${YFLAGS-'--defines=$*.h'}]) +# +# Other tools used for installation, and distribution packaging. +# + AC_PROG_LN_S + AC_PROG_MKDIR_P + AC_PROG_INSTALL +# +# Generate configuration. +# + AC_CONFIG_FILES([Makefile]) + AC_OUTPUT +# +# configure.ac: end of file -- 2.11.0