5 PACKAGE_TARNAME = @PACKAGE_TARNAME@
6 PACKAGE_VERSION = @PACKAGE_VERSION@
8 # Written by Keith Marshall <keithmarshall@users.sourceforge.net>
9 # Copyright (C) 2009, 2010, MinGW Project
12 # Makefile template for mingw-get
15 # This is free software. Permission is granted to copy, modify and
16 # redistribute this software, under the provisions of the GNU General
17 # Public License, Version 3, (or, at your option, any later version),
18 # as published by the Free Software Foundation; see the file COPYING
19 # for licensing details.
21 # Note, in particular, that this software is provided "as is", in the
22 # hope that it may prove useful, but WITHOUT WARRANTY OF ANY KIND; not
23 # even an implied WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR ANY
24 # PARTICULAR PURPOSE. Under no circumstances will the author, or the
25 # MinGW Project, accept liability for any damages, however caused,
26 # arising from the use of this software.
28 PACKAGE_SUBSYSTEM = @host_os@
31 abs_top_srcdir = @abs_top_srcdir@
35 VPATH = @top_srcdir@/src:@top_srcdir@/src/pkginfo:@top_srcdir@/tinyxml
39 CPPFLAGS = @CPPFLAGS@ -D DEBUGLEVEL=$(DEBUGLEVEL) $(INCLUDES)
44 INCLUDES = -I ${srcdir}/src -I ${srcdir}/src/pkginfo -I ${srcdir}/tinyxml
55 LIBS = -Wl,-Bstatic -lz -lbz2 -llzma -Wl,-Bdynamic -lwininet
57 CORE_DLL_OBJECTS = climain.$(OBJEXT) \
58 pkgbind.$(OBJEXT) pkginet.$(OBJEXT) pkgstrm.$(OBJEXT) pkgname.$(OBJEXT) \
59 pkgexec.$(OBJEXT) pkgfind.$(OBJEXT) pkginfo.$(OBJEXT) pkgspec.$(OBJEXT) \
60 sysroot.$(OBJEXT) pkghash.$(OBJEXT) pkgkeys.$(OBJEXT) pkgdeps.$(OBJEXT) \
61 mkpath.$(OBJEXT) pkgreqs.$(OBJEXT) pkginst.$(OBJEXT) tarproc.$(OBJEXT) \
62 xmlfile.$(OBJEXT) keyword.$(OBJEXT) vercmp.$(OBJEXT) dmh.$(OBJEXT) \
63 tinyxml.$(OBJEXT) tinyxmlparser.$(OBJEXT) \
64 tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT)
66 all: pkginfo$(EXEEXT) mingw-get$(EXEEXT) mingw-get-0.dll
68 pkginfo$(EXEEXT): driver.$(OBJEXT) pkginfo.$(OBJEXT)
69 $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $+
71 mingw-get$(EXEEXT): clistub.$(OBJEXT) version.$(OBJEXT)
72 $(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $+
74 mingw-get-0.dll: $(CORE_DLL_OBJECTS)
75 $(CXX) -shared -o $@ $(CXXFLAGS) $(LDFLAGS) $+ $(LIBS)
77 # Compilation and dependency tracking...
79 DEPFLAGS = -MM -MP -MD
83 $(CC) $(DEPFLAGS) $(CPPFLAGS) $(CFLAGS) $<
84 $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
87 $(CXX) $(DEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $<
88 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
90 # Installation tools and directory paths...
92 mkinstalldirs = @MKDIR_P@
95 exec_prefix = @exec_prefix@
96 localstatedir = @localstatedir@
97 libexecdir = @libexecdir@
100 PACKAGE_CONFIG_DIR = ${localstatedir}/lib/${PACKAGE_TARNAME}/data
103 INSTALL_DATA = @INSTALL_DATA@
104 INSTALL_PROGRAM = @INSTALL_PROGRAM@
105 INSTALL_SCRIPT = @INSTALL_SCRIPT@
110 # Installation rules...
113 $(mkinstalldirs) ${bindir}
114 $(mkinstalldirs) ${libexecdir}/${PACKAGE_TARNAME}
115 $(mkinstalldirs) ${PACKAGE_CONFIG_DIR}
117 install: installdirs install-profile
118 $(INSTALL_PROGRAM) pkginfo$(EXEEXT) ${bindir}
119 $(INSTALL_PROGRAM) mingw-get$(EXEEXT) ${bindir}
120 $(INSTALL_DATA) mingw-get-0.dll ${libexecdir}/${PACKAGE_TARNAME}
123 $(INSTALL_DATA) ${srcdir}/xml/profile.xml \
124 ${PACKAGE_CONFIG_DIR}/defaults.xml
126 install-strip: install
127 $(STRIP) ${bindir}/pkginfo$(EXEEXT)
128 $(STRIP) ${bindir}/mingw-get$(EXEEXT)
129 $(STRIP) ${libexecdir}/${PACKAGE_TARNAME}/mingw-get-0.dll
131 # Packaging and distribution...
133 LICENCE_FILES = README COPYING
134 SRCDIST_FILES = $(LICENCE_FILES) ChangeLog version.c.in \
135 configure.ac configure Makefile.in install-sh
137 SRCDIST_SUBDIRS = src src/pkginfo tinyxml xml
139 # The names of distributed pacakge archive files incorporate version
140 # information, derived from PACKAGE_VERSION; this is decomposed, so that
141 # the PACKAGE_SUBSYSTEM may be interposed between the principal version
142 # number and any qualifying suffix, which specifies development status.
143 # Additionally, the package maintainer may specify, (at `make dist' time),
144 # a SNAPSHOT qualifier; if specified, this will be appended, (literally),
145 # to the principal version number component of the package version number,
146 # as it appears in the distributed archive file names.
148 PACKAGE_DISTROOT = $(PACKAGE_TARNAME)-$(PACKAGE_ROOTVERSION)
149 PACKAGE_ROOTVERSION = `echo $(PACKAGE_VERSION) | sed 's,-[^0-9].*,,'`
150 PACKAGE_DISTVERSION = `echo $(PACKAGE_VERSION)-$(PACKAGE_SUBSYSTEM) | sed \
151 -e 's,-[^0-9],-$(PACKAGE_SUBSYSTEM)&,' \
152 -e 's,\(-$(PACKAGE_SUBSYSTEM).*\)-$(PACKAGE_SUBSYSTEM),\1,' \
153 -e 's,-$(PACKAGE_SUBSYSTEM),$(SNAPSHOT)&,'`
154 PACKAGE_DISTNAME = $(PACKAGE_TARNAME)-$(PACKAGE_DISTVERSION)
156 dist: srcdist bindist
160 $(MAKE) --no-print-directory prefix=`pwd`/staged install-strip
161 cd staged; tar chf - bin/pkginfo$(EXEEXT) | gzip -c > \
162 ../pkginfo-$(PACKAGE_DISTVERSION)-bin.tar.gz
163 rm staged/bin/pkginfo$(EXEEXT)
164 cd staged; tar chf - * | gzip -c > ../$(PACKAGE_DISTNAME)-bin.tar.gz
165 cd staged; zip -r ../$(PACKAGE_DISTNAME)-bin.zip *
170 $(mkinstalldirs) ./shared/doc/${PACKAGE_TARNAME}
171 cd ./shared/doc/${PACKAGE_TARNAME}; for file in $(LICENCE_FILES); \
172 do $(LN_S) ${abs_top_srcdir}/$$file .; done
173 tar chf - shared | gzip -c > $(PACKAGE_DISTNAME)-lic.tar.gz
177 rm -rf ${PACKAGE_DISTROOT} && mkdir ${PACKAGE_DISTROOT}
178 cd ${PACKAGE_DISTROOT}; for file in $(SRCDIST_FILES); do \
179 $(LN_S) ${abs_top_srcdir}/$$file .; done
180 for dir in $(SRCDIST_SUBDIRS); do \
181 mkdir ${PACKAGE_DISTROOT}/$$dir && cd ${PACKAGE_DISTROOT}/$$dir; \
182 for file in `cd ${abs_top_srcdir}/$$dir && echo *`; do \
183 if test -f ${abs_top_srcdir}/$$dir/$$file; then \
184 $(LN_S) ${abs_top_srcdir}/$$dir/$$file .; \
188 cd ${PACKAGE_DISTROOT}/src/pkginfo; $(LN_S) ${CURDIR}/$^ .
189 tar chf - ${PACKAGE_DISTROOT} | gzip -c > ${PACKAGE_DISTNAME}-src.tar.gz
190 rm -rf ${PACKAGE_DISTROOT}
192 # Workspace clean-up...
195 rm -f *.$(OBJEXT) *.d *.dll pkginfo$(EXEEXT) mingw-get$(EXEEXT)
198 rm -f config.* version.c Makefile
200 maintainer-clean: distclean
201 rm -f pkginfo.c *-$(PACKAGE_DISTVERSION)-*.tar.gz
202 rm -rf ${PACKAGE_DISTROOT} staged
204 # $RCSfile$: end of file