PACKAGE_VERSION = @PACKAGE_VERSION@
# Written by Keith Marshall <keithmarshall@users.sourceforge.net>
-# Copyright (C) 2009, 2010, 2011, MinGW Project
+# Copyright (C) 2009, 2010, 2011, 2012, MinGW Project
#
#
# Makefile template for mingw-get
srcdir = @srcdir@
abs_top_srcdir = @abs_top_srcdir@
-DEBUGLEVEL = 0
+DEBUGLEVEL = @DEBUGLEVEL@
VPATH = @top_srcdir@/src:@top_srcdir@/src/pkginfo:@top_srcdir@/tinyxml
EXEEXT = @EXEEXT@
LDFLAGS = @LDFLAGS@
-LIBS = -Wl,-Bstatic -lz -lbz2 -llzma -Wl,-Bdynamic -lwininet
+LIBS = -Wl,-Bstatic -llua -lz -lbz2 -llzma -Wl,-Bdynamic -lwininet
CORE_DLL_OBJECTS = climain.$(OBJEXT) pkgshow.$(OBJEXT) dmh.$(OBJEXT) \
pkgbind.$(OBJEXT) pkginet.$(OBJEXT) pkgstrm.$(OBJEXT) pkgname.$(OBJEXT) \
tinyxml.$(OBJEXT) tinyxmlparser.$(OBJEXT) \
tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT)
+script_srcdir = ${srcdir}/scripts/libexec
+
BIN_PROGRAMS = pkginfo$(EXEEXT) mingw-get$(EXEEXT)
LIBEXEC_PROGRAMS = gui$(EXEEXT) lastrites$(EXEEXT)
+LIBEXEC_SCRIPTS = ${script_srcdir}/setup.lua ${script_srcdir}/wsh.lua \
+ ${script_srcdir}/shlink.js ${script_srcdir}/unlink.js
LIBEXEC_DATA = mingw-get-0.dll
all: $(BIN_PROGRAMS) $(LIBEXEC_PROGRAMS) $(LIBEXEC_DATA)
pkginfo$(EXEEXT): driver.$(OBJEXT) pkginfo.$(OBJEXT)
$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $+
-mingw-get$(EXEEXT): clistub.$(OBJEXT) version.$(OBJEXT)
+mingw-get$(EXEEXT): clistub.$(OBJEXT) version.$(OBJEXT) getopt.$(OBJEXT)
$(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $+
GUI_LDFLAGS = -mwindows $(LDFLAGS)
for image in $(LIBEXEC_PROGRAMS); do \
$(INSTALL_PROGRAM) $$image ${libexecdir}/${PACKAGE_TARNAME}; \
done
- for image in $(LIBEXEC_DATA); do \
+ for image in $(LIBEXEC_DATA) $(LIBEXEC_SCRIPTS); do \
$(INSTALL_DATA) $$image ${libexecdir}/${PACKAGE_TARNAME}; \
done
SRCDIST_FILES = $(LICENCE_FILES) ChangeLog NEWS INSTALL \
aclocal.m4 configure.ac configure Makefile.in version.c.in
-SRCDIST_SUBDIRS = build-aux m4 src src/pkginfo srcdist-doc tinyxml xml
+SRCDIST_SUBDIRS = build-aux m4 src src/pkginfo srcdist-doc \
+ scripts/libexec tinyxml xml
# The names of distributed pacakge archive files incorporate version
# information, derived from PACKAGE_VERSION; this is decomposed, so that
dist: srcdist bindist readme.txt
+# Specify default compression command, and associated file name extension,
+# for creation and identification of packaged tar archives.
+#
+TARZIP = xz
+TAREXT = tar.$(TARZIP)
+
bindist: all licdist
rm -rf staged
$(MAKE) --no-print-directory prefix=`pwd`/staged install-strip
- cd staged; tar chf - bin/pkginfo$(EXEEXT) | gzip -c > \
- ../pkginfo-$(PACKAGE_DISTVERSION)-bin.tar.gz
+ cd staged; tar chf - bin/pkginfo$(EXEEXT) | $(TARZIP) -c > \
+ ../pkginfo-$(PACKAGE_DISTVERSION)-bin.$(TAREXT)
rm staged/bin/pkginfo$(EXEEXT)
- cd staged; tar chf - * | gzip -c > ../$(PACKAGE_DISTNAME)-bin.tar.gz
+ cd staged; tar chf - * | $(TARZIP) -c > \
+ ../$(PACKAGE_DISTNAME)-bin.$(TAREXT)
cd staged; zip -r ../$(PACKAGE_DISTNAME)-bin.zip *
rm -rf staged
cd ./share/doc/${PACKAGE_TARNAME}; for file in $(LICENCE_FILES); \
do test -f ${abs_top_srcdir}/$$file \
&& $(LN_S) ${abs_top_srcdir}/$$file . \
- || $(LN_S) ../$$file .; \
+ || $(LN_S) ${CURDIR}/$$file .; \
done
- tar chf - share | gzip -c > $(PACKAGE_DISTNAME)-lic.tar.gz
+ tar chf - share | $(TARZIP) -c > $(PACKAGE_DISTNAME)-lic.$(TAREXT)
rm -rf share
-srcdist: pkginfo.c srcdist-doc
+srcdist: srcdist-doc
rm -rf ${PACKAGE_DISTROOT} && mkdir ${PACKAGE_DISTROOT}
cd ${PACKAGE_DISTROOT}; for file in $(SRCDIST_FILES); do \
test -f ${abs_top_srcdir}/$$file \
fi; \
done; \
cd ${CURDIR}; done
- cd ${PACKAGE_DISTROOT}/src/pkginfo; $(LN_S) ${CURDIR}/$^ .
- tar chf - ${PACKAGE_DISTROOT} | gzip -c > ${PACKAGE_DISTNAME}-src.tar.gz
+ cd ${PACKAGE_DISTROOT}/src/pkginfo; $(LN_S) ${CURDIR}/pkginfo.c .
+ tar chf - ${PACKAGE_DISTROOT} | $(TARZIP) -c > \
+ ${PACKAGE_DISTNAME}-src.$(TAREXT)
rm -rf ${PACKAGE_DISTROOT}
# README, INSTALL and NEWS files to be included in the source distribution
vpath %.in ${srcdir}/srcdist-doc
srcdist-doc: README.dist NEWS.dist INSTALL.dist
+# We need to ensure that, when we invoke nroff, the generated output
+# will be suited to an ASCII class of typesetter; without the -Tascii
+# option, GNU nroff will substitute Unicode hyphens (u2010) in place
+# of ASCII hyphens (code 45).
+#
+NROFF = nroff -Tascii
+
%.dist: %.in gendoc.simple.sed
- sed -f gendoc.simple.sed $< | nroff > $*
+ sed -f gendoc.simple.sed $< | $(NROFF) > $*
%.simple.sed: %.sed.in
sed -e s,'$${PACKAGE_DIRNAME}',"${PACKAGE_DISTROOT}", \
-e s,'$${PACKAGE_DISTNAME}',"${PACKAGE_DISTNAME}", \
-e s,'^# *cut:',, $< > $@
+# The following rules use sed and awk to match the RCS Id keyword;
+# we define and use the following macro, in the form "$(DOLLAR)Id:",
+# to avoid unwanted substitution on CVS checkout.
+#
+DOLLAR = $$
+
# The following rule provides a mechanism for generating a composite from
# README, INSTALL and NEWS, for use as an on-line package description.
#
-readme.txt: README.in NEWS.in INSTALL.in gendoc.combined.sed
+readme.txt: gendoc.combined.sed readme.txt.tag readme.txt.in
+ sed s,'$(DOLLAR)Id:.*',"`cat $@.tag`", $@.in > $@
+ echo '$$Document: $@ $$: end of file' >> $@
+ rm -f gendoc.combined.sed $@.*
+
+# There should be a new generation of readme.txt for each package release;
+# since each release should also include an updated NEWS file; we adopt the
+# ID tag-line from NEWS.in, as most the appropriate template for generation
+# of a corresponding tag-line for readme.in
+#
+readme.txt.tag: NEWS.in
+ awk '/\$(DOLLAR)Id:/{ $$2 = "readme.txt\\,v"; print }' $^ > $@
+
+# The tag-line generated by the preceding rule may then be substituted, by
+# the primary readme.txt generation rule above, into the document template
+# generated by the following rule
+#
+readme.txt.in: README.in NEWS.in INSTALL.in
rm -f $@
for input in $^; do \
- case $$input in *.in) \
- sed -f gendoc.combined.sed $$input | nroff >> $@ ;; \
- esac; \
+ sed -f gendoc.combined.sed $$input | $(NROFF) >> $@; \
done
- echo '$$Document: $@ $$: end of file' >> $@
- rm -f gendoc.combined.sed
# Workspace clean-up...
#
maintainer-clean: distclean
rm -f README NEWS INSTALL readme.txt Makefile pkginfo.c
- rm -f *-$(PACKAGE_DISTVERSION)-*.tar.gz *-$(PACKAGE_DISTVERSION)-*.zip
+ rm -f *-$(PACKAGE_DISTVERSION)-*.tar.* *-$(PACKAGE_DISTVERSION)-*.zip
rm -rf ${PACKAGE_DISTROOT} staged ${srcdir}/autom4te.cache
# $RCSfile$: end of file