# @configure_input@
#
# $Id$
-#
+
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+
# Written by Keith Marshall <keithmarshall@users.sourceforge.net>
-# Copyright (C) 2009, 2010, MinGW Project
+# Copyright (C) 2009, 2010, 2011, 2012, MinGW Project
#
#
# Makefile template for mingw-get
# MinGW Project, accept liability for any damages, however caused,
# arising from the use of this software.
#
+PACKAGE_SUBSYSTEM = @host_os@
+
srcdir = @srcdir@
+abs_top_srcdir = @abs_top_srcdir@
-VPATH = ${srcdir}/src ${srcdir}/src/pkginfo ${srcdir}/tinyxml
+DEBUGLEVEL = @DEBUGLEVEL@
+
+vpath %.ico @srcdir@/icons
+VPATH = @top_srcdir@/src:@top_srcdir@/src/pkginfo:@top_srcdir@/tinyxml
CC = @CC@
CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@ $(INCLUDES)
+CPPFLAGS = @CPPFLAGS@ -D DEBUGLEVEL=$(DEBUGLEVEL) $(INCLUDES)
CXX = @CXX@
CXXFLAGS = $(CFLAGS)
AR = @AR@
ARFLAGS = @ARFLAGS@
+WINDRES = @WINDRES@
+
OBJEXT = @OBJEXT@
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) \
+CORE_DLL_OBJECTS = climain.$(OBJEXT) pkgshow.$(OBJEXT) dmh.$(OBJEXT) \
pkgbind.$(OBJEXT) pkginet.$(OBJEXT) pkgstrm.$(OBJEXT) pkgname.$(OBJEXT) \
pkgexec.$(OBJEXT) pkgfind.$(OBJEXT) pkginfo.$(OBJEXT) pkgspec.$(OBJEXT) \
- pkgkeys.$(OBJEXT) \
- mkpath.$(OBJEXT) xmlfile.$(OBJEXT) keyword.$(OBJEXT) \
- tinyxml.$(OBJEXT) tinyxmlparser.$(OBJEXT) \
- tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT) \
- vercmp.$(OBJEXT) dmh.$(OBJEXT)
+ pkgopts.$(OBJEXT) sysroot.$(OBJEXT) pkghash.$(OBJEXT) pkgkeys.$(OBJEXT) \
+ pkgdeps.$(OBJEXT) pkgreqs.$(OBJEXT) pkginst.$(OBJEXT) pkgunst.$(OBJEXT) \
+ tarproc.$(OBJEXT) xmlfile.$(OBJEXT) keyword.$(OBJEXT) vercmp.$(OBJEXT) \
+ tinyxml.$(OBJEXT) tinystr.$(OBJEXT) tinyxmlparser.$(OBJEXT) \
+ mkpath.$(OBJEXT) tinyxmlerror.$(OBJEXT)
-%.$(OBJEXT): %.c
- $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
+CLI_EXE_OBJECTS = \
+ clistub.$(OBJEXT) version.$(OBJEXT) approot.$(OBJEXT) getopt.$(OBJEXT)
-%.$(OBJEXT): %.cpp
- $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
+script_srcdir = ${srcdir}/scripts/libexec
-all: pkginfo$(EXEEXT) mingw-get$(EXEEXT) mingw-get-0.dll
+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): $(CLI_EXE_OBJECTS)
$(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $+
+GUI_LDFLAGS = -mwindows $(LDFLAGS)
+
+# FIXME: the following is a Q&D kludge, to assign my choice of icon
+# to the GUI mode executable stub. Eventually, this will need to be
+# assigned within a resource definition file, but for the time being,
+# besides providing a notification that the GUI is not yet available,
+# the stub serves only to illustrate mingw-get's shortcut creation
+# capability; thus, this simple hack will suffice.
+#
+%.$(OBJEXT): %.ico
+ echo $* ICON $*.ico | $(WINDRES) -I ${srcdir}/icons -o $@
+#
+gui$(EXEEXT): guistub.$(OBJEXT) pkgicon.$(OBJEXT)
+ $(CXX) -o $@ $(CXXFLAGS) $(GUI_LDFLAGS) $+
+
+lastrites$(EXEEXT): rites.$(OBJEXT)
+ $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $+
+
mingw-get-0.dll: $(CORE_DLL_OBJECTS)
$(CXX) -shared -o $@ $(CXXFLAGS) $(LDFLAGS) $+ $(LIBS)
-dmh.$(OBJEXT): dmh.h
-climain.$(OBJEXT): pkgbase.h pkgtask.h tinyxml.h tinystr.h dmh.h
+# Compilation and dependency tracking...
+#
+DEPFLAGS = -MM -MP -MD
+sinclude *.d
+
+%.$(OBJEXT): %.c
+ $(CC) $(DEPFLAGS) $(CPPFLAGS) $(CFLAGS) $<
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
+
+%.$(OBJEXT): %.cpp
+ $(CXX) $(DEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $<
+ $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
+
+# Installation tools and directory paths...
+#
+mkinstalldirs = @MKDIR_P@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+localstatedir = @localstatedir@
+libexecdir = @libexecdir@
+bindir = @bindir@
+
+PACKAGE_CONFIG_DIR = ${localstatedir}/lib/${PACKAGE_TARNAME}/data
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
-pkgname.$(OBJEXT): pkgbase.h pkgkeys.h dmh.h
-pkgfind.$(OBJEXT): pkgbase.h pkgkeys.h tinyxml.h tinystr.h
-pkgbind.$(OBJEXT): pkgbase.h pkgkeys.h tinyxml.h tinystr.h dmh.h
-pkgexec.$(OBJEXT): pkgbase.h pkgkeys.h pkgtask.h tinyxml.h tinystr.h mkpath.h dmh.h
-pkgspec.$(OBJEXT): pkgbase.h pkgkeys.h pkginfo.h tinyxml.h tinystr.h vercmp.h
-pkginet.$(OBJEXT): pkgbase.h pkgkeys.h pkgtask.h pkgstrm.h mkpath.h dmh.h
-pkgstrm.$(OBJEXT): pkgstrm.h
+STRIP = @STRIP@
+LN_S = @LN_S@
-# Dependencies for stand alone pkginfo tool;
-# (the pkginfo object is also required by the core DLL)...
+# Installation rules...
#
-driver.$(OBJEXT): pkginfo.h
-pkginfo.$(OBJEXT): pkginfo.l pkginfo.h
+installdirs:
+ $(mkinstalldirs) ${bindir}
+ $(mkinstalldirs) ${libexecdir}/${PACKAGE_TARNAME}
+ $(mkinstalldirs) ${PACKAGE_CONFIG_DIR}
-# TinyXML dependencies...
+install: installdirs install-profile
+ for image in $(BIN_PROGRAMS); do \
+ $(INSTALL_PROGRAM) $$image ${bindir}; \
+ done
+ for image in $(LIBEXEC_PROGRAMS); do \
+ $(INSTALL_PROGRAM) $$image ${libexecdir}/${PACKAGE_TARNAME}; \
+ done
+ for image in $(LIBEXEC_DATA) $(LIBEXEC_SCRIPTS); do \
+ $(INSTALL_DATA) $$image ${libexecdir}/${PACKAGE_TARNAME}; \
+ done
+
+install-profile:
+ $(INSTALL_DATA) ${srcdir}/xml/profile.xml \
+ ${PACKAGE_CONFIG_DIR}/defaults.xml
+
+install-strip: install
+ for image in $(BIN_PROGRAMS); do \
+ $(STRIP) ${bindir}/$$image; \
+ done
+ for image in $(LIBEXEC_PROGRAMS) $(LIBEXEC_DATA); do \
+ $(STRIP) ${libexecdir}/${PACKAGE_TARNAME}/$$image; \
+ done
+
+# Packaging and distribution...
+#
+LICENCE_FILES = README COPYING
+SRCDIST_FILES = $(LICENCE_FILES) ChangeLog NEWS INSTALL \
+ aclocal.m4 configure.ac configure Makefile.in version.c.in
+
+SRCDIST_SUBDIRS = build-aux icons 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
+# the PACKAGE_SUBSYSTEM may be interposed between the principal version
+# number and any qualifying suffix, which specifies development status.
+# Additionally, the package maintainer may specify, (at `make dist' time),
+# a SNAPSHOT qualifier; if specified, this will be appended, (literally),
+# to the principal version number component of the package version number,
+# as it appears in the distributed archive file names.
#
-tinyxml.$(OBJEXT): tinyxml.h tinystr.h
-tinyxmlerror.$(OBJEXT): tinyxml.h tinystr.h
-tinyxmlparser.$(OBJEXT): tinyxml.h tinystr.h
-tinystr.$(OBJEXT): tinystr.h
+PACKAGE_DISTROOT = $(PACKAGE_TARNAME)-$(PACKAGE_ROOTVERSION)
+PACKAGE_ROOTVERSION = `echo $(PACKAGE_VERSION) | sed 's,-[^0-9].*,,'`
+PACKAGE_DISTVERSION = `echo $(PACKAGE_VERSION)-$(PACKAGE_SUBSYSTEM) | sed \
+ -e 's,-[^0-9],-$(PACKAGE_SUBSYSTEM)&,' \
+ -e 's,\(-$(PACKAGE_SUBSYSTEM).*\)-$(PACKAGE_SUBSYSTEM),\1,' \
+ -e 's,-$(PACKAGE_SUBSYSTEM),$(SNAPSHOT)&,'`
+PACKAGE_DISTNAME = $(PACKAGE_TARNAME)-$(PACKAGE_DISTVERSION)
+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) | $(TARZIP) -c > \
+ ../pkginfo-$(PACKAGE_DISTVERSION)-bin.$(TAREXT)
+ rm staged/bin/pkginfo$(EXEEXT)
+ cd staged; tar chf - * | $(TARZIP) -c > \
+ ../$(PACKAGE_DISTNAME)-bin.$(TAREXT)
+ cd staged; zip -r ../$(PACKAGE_DISTNAME)-bin.zip *
+ rm -rf staged
+
+licdist:
+ rm -rf share
+ $(mkinstalldirs) ./share/doc/${PACKAGE_TARNAME}
+ 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) ${CURDIR}/$$file .; \
+ done
+ tar chf - share | $(TARZIP) -c > $(PACKAGE_DISTNAME)-lic.$(TAREXT)
+ rm -rf share
+
+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 \
+ && $(LN_S) ${abs_top_srcdir}/$$file . \
+ || $(LN_S) ../$$file .; \
+ done
+ for dir in $(SRCDIST_SUBDIRS); do \
+ $(mkinstalldirs) ${PACKAGE_DISTROOT}/$$dir \
+ && cd ${PACKAGE_DISTROOT}/$$dir; \
+ for file in `cd ${abs_top_srcdir}/$$dir && echo *`; do \
+ if test -f ${abs_top_srcdir}/$$dir/$$file; then \
+ $(LN_S) ${abs_top_srcdir}/$$dir/$$file .; \
+ fi; \
+ done; \
+ cd ${CURDIR}; done
+ 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
+# are generated on demand, as indirect side effects of a set of phoney goals
+# so that they are always regenerated for each distribution, from templates
+# in srcdist-doc so that we can make them version specific.
+#
+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) > $*
+
+%.simple.sed: %.sed.in
+ sed -e s,'$${PACKAGE_DIRNAME}',"${PACKAGE_DISTROOT}", \
+ -e s,'$${PACKAGE_DISTNAME}',"${PACKAGE_DISTNAME}", $< > $@
+
+%.combined.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: 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 \
+ sed -f gendoc.combined.sed $$input | $(NROFF) >> $@; \
+ done
+
+# Workspace clean-up...
+#
clean:
- rm -f *.$(OBJEXT) *.dll pkginfo$(EXEEXT) mingw-get$(EXEEXT)
+ rm -f *.$(OBJEXT) *.d *.dll $(BIN_PROGRAMS) $(LIBEXEC_PROGRAMS)
distclean: clean
- rm -f config.* version.c Makefile
+ rm -f config.* version.c
+
+maintainer-clean: distclean
+ rm -f README NEWS INSTALL readme.txt Makefile pkginfo.c
+ rm -f *-$(PACKAGE_DISTVERSION)-*.tar.* *-$(PACKAGE_DISTVERSION)-*.zip
+ rm -rf ${PACKAGE_DISTROOT} staged ${srcdir}/autom4te.cache
# $RCSfile$: end of file