5 PACKAGE_TARNAME = @PACKAGE_TARNAME@
6 PACKAGE_VERSION = @PACKAGE_VERSION@
8 # Written by Keith Marshall <keithmarshall@users.sourceforge.net>
9 # Copyright (C) 2009, 2010, 2011, 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@
33 DEBUGLEVEL = @DEBUGLEVEL@
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 -llua -lz -lbz2 -llzma -Wl,-Bdynamic -lwininet
57 CORE_DLL_OBJECTS = climain.$(OBJEXT) pkgshow.$(OBJEXT) dmh.$(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) pkgunst.$(OBJEXT) \
62 tarproc.$(OBJEXT) xmlfile.$(OBJEXT) keyword.$(OBJEXT) vercmp.$(OBJEXT) \
63 tinyxml.$(OBJEXT) tinyxmlparser.$(OBJEXT) \
64 tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT)
66 BIN_PROGRAMS = pkginfo$(EXEEXT) mingw-get$(EXEEXT)
67 LIBEXEC_PROGRAMS = gui$(EXEEXT) lastrites$(EXEEXT)
68 LIBEXEC_DATA = mingw-get-0.dll
70 all: $(BIN_PROGRAMS) $(LIBEXEC_PROGRAMS) $(LIBEXEC_DATA)
72 pkginfo$(EXEEXT): driver.$(OBJEXT) pkginfo.$(OBJEXT)
73 $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $+
75 mingw-get$(EXEEXT): clistub.$(OBJEXT) version.$(OBJEXT) getopt.$(OBJEXT)
76 $(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $+
78 GUI_LDFLAGS = -mwindows $(LDFLAGS)
80 gui$(EXEEXT): guimain.$(OBJEXT)
81 $(CXX) -o $@ $(CXXFLAGS) $(GUI_LDFLAGS) $+
83 lastrites$(EXEEXT): rites.$(OBJEXT)
84 $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $+
86 mingw-get-0.dll: $(CORE_DLL_OBJECTS)
87 $(CXX) -shared -o $@ $(CXXFLAGS) $(LDFLAGS) $+ $(LIBS)
89 # Compilation and dependency tracking...
91 DEPFLAGS = -MM -MP -MD
95 $(CC) $(DEPFLAGS) $(CPPFLAGS) $(CFLAGS) $<
96 $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
99 $(CXX) $(DEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $<
100 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
102 # Installation tools and directory paths...
104 mkinstalldirs = @MKDIR_P@
107 exec_prefix = @exec_prefix@
108 localstatedir = @localstatedir@
109 libexecdir = @libexecdir@
112 PACKAGE_CONFIG_DIR = ${localstatedir}/lib/${PACKAGE_TARNAME}/data
115 INSTALL_DATA = @INSTALL_DATA@
116 INSTALL_PROGRAM = @INSTALL_PROGRAM@
117 INSTALL_SCRIPT = @INSTALL_SCRIPT@
122 # Installation rules...
125 $(mkinstalldirs) ${bindir}
126 $(mkinstalldirs) ${libexecdir}/${PACKAGE_TARNAME}
127 $(mkinstalldirs) ${PACKAGE_CONFIG_DIR}
129 install: installdirs install-profile
130 for image in $(BIN_PROGRAMS); do \
131 $(INSTALL_PROGRAM) $$image ${bindir}; \
133 for image in $(LIBEXEC_PROGRAMS); do \
134 $(INSTALL_PROGRAM) $$image ${libexecdir}/${PACKAGE_TARNAME}; \
136 for image in $(LIBEXEC_DATA); do \
137 $(INSTALL_DATA) $$image ${libexecdir}/${PACKAGE_TARNAME}; \
141 $(INSTALL_DATA) ${srcdir}/xml/profile.xml \
142 ${PACKAGE_CONFIG_DIR}/defaults.xml
144 install-strip: install
145 for image in $(BIN_PROGRAMS); do \
146 $(STRIP) ${bindir}/$$image; \
148 for image in $(LIBEXEC_PROGRAMS) $(LIBEXEC_DATA); do \
149 $(STRIP) ${libexecdir}/${PACKAGE_TARNAME}/$$image; \
152 # Packaging and distribution...
154 LICENCE_FILES = README COPYING
155 SRCDIST_FILES = $(LICENCE_FILES) ChangeLog NEWS INSTALL \
156 aclocal.m4 configure.ac configure Makefile.in version.c.in
158 SRCDIST_SUBDIRS = build-aux m4 src src/pkginfo srcdist-doc tinyxml xml
160 # The names of distributed pacakge archive files incorporate version
161 # information, derived from PACKAGE_VERSION; this is decomposed, so that
162 # the PACKAGE_SUBSYSTEM may be interposed between the principal version
163 # number and any qualifying suffix, which specifies development status.
164 # Additionally, the package maintainer may specify, (at `make dist' time),
165 # a SNAPSHOT qualifier; if specified, this will be appended, (literally),
166 # to the principal version number component of the package version number,
167 # as it appears in the distributed archive file names.
169 PACKAGE_DISTROOT = $(PACKAGE_TARNAME)-$(PACKAGE_ROOTVERSION)
170 PACKAGE_ROOTVERSION = `echo $(PACKAGE_VERSION) | sed 's,-[^0-9].*,,'`
171 PACKAGE_DISTVERSION = `echo $(PACKAGE_VERSION)-$(PACKAGE_SUBSYSTEM) | sed \
172 -e 's,-[^0-9],-$(PACKAGE_SUBSYSTEM)&,' \
173 -e 's,\(-$(PACKAGE_SUBSYSTEM).*\)-$(PACKAGE_SUBSYSTEM),\1,' \
174 -e 's,-$(PACKAGE_SUBSYSTEM),$(SNAPSHOT)&,'`
175 PACKAGE_DISTNAME = $(PACKAGE_TARNAME)-$(PACKAGE_DISTVERSION)
177 dist: srcdist bindist readme.txt
179 # Specify default compression command, and associated file name extension,
180 # for creation and identification of packaged tar archives.
183 TAREXT = tar.$(TARZIP)
187 $(MAKE) --no-print-directory prefix=`pwd`/staged install-strip
188 cd staged; tar chf - bin/pkginfo$(EXEEXT) | $(TARZIP) -c > \
189 ../pkginfo-$(PACKAGE_DISTVERSION)-bin.$(TAREXT)
190 rm staged/bin/pkginfo$(EXEEXT)
191 cd staged; tar chf - * | $(TARZIP) -c > \
192 ../$(PACKAGE_DISTNAME)-bin.$(TAREXT)
193 cd staged; zip -r ../$(PACKAGE_DISTNAME)-bin.zip *
198 $(mkinstalldirs) ./share/doc/${PACKAGE_TARNAME}
199 cd ./share/doc/${PACKAGE_TARNAME}; for file in $(LICENCE_FILES); \
200 do test -f ${abs_top_srcdir}/$$file \
201 && $(LN_S) ${abs_top_srcdir}/$$file . \
202 || $(LN_S) ${CURDIR}/$$file .; \
204 tar chf - share | $(TARZIP) -c > $(PACKAGE_DISTNAME)-lic.$(TAREXT)
208 rm -rf ${PACKAGE_DISTROOT} && mkdir ${PACKAGE_DISTROOT}
209 cd ${PACKAGE_DISTROOT}; for file in $(SRCDIST_FILES); do \
210 test -f ${abs_top_srcdir}/$$file \
211 && $(LN_S) ${abs_top_srcdir}/$$file . \
212 || $(LN_S) ../$$file .; \
214 for dir in $(SRCDIST_SUBDIRS); do \
215 mkdir ${PACKAGE_DISTROOT}/$$dir && cd ${PACKAGE_DISTROOT}/$$dir; \
216 for file in `cd ${abs_top_srcdir}/$$dir && echo *`; do \
217 if test -f ${abs_top_srcdir}/$$dir/$$file; then \
218 $(LN_S) ${abs_top_srcdir}/$$dir/$$file .; \
222 cd ${PACKAGE_DISTROOT}/src/pkginfo; $(LN_S) ${CURDIR}/pkginfo.c .
223 tar chf - ${PACKAGE_DISTROOT} | $(TARZIP) -c > \
224 ${PACKAGE_DISTNAME}-src.$(TAREXT)
225 rm -rf ${PACKAGE_DISTROOT}
227 # README, INSTALL and NEWS files to be included in the source distribution
228 # are generated on demand, as indirect side effects of a set of phoney goals
229 # so that they are always regenerated for each distribution, from templates
230 # in srcdist-doc so that we can make them version specific.
232 vpath %.in ${srcdir}/srcdist-doc
233 srcdist-doc: README.dist NEWS.dist INSTALL.dist
235 # We need to ensure that, when we invoke nroff, the generated output
236 # will be suited to an ASCII class of typesetter; without the -Tascii
237 # option, GNU nroff will substitute Unicode hyphens (u2010) in place
238 # of ASCII hyphens (code 45).
240 NROFF = nroff -Tascii
242 %.dist: %.in gendoc.simple.sed
243 sed -f gendoc.simple.sed $< | $(NROFF) > $*
245 %.simple.sed: %.sed.in
246 sed -e s,'$${PACKAGE_DIRNAME}',"${PACKAGE_DISTROOT}", \
247 -e s,'$${PACKAGE_DISTNAME}',"${PACKAGE_DISTNAME}", $< > $@
249 %.combined.sed: %.sed.in
250 sed -e s,'$${PACKAGE_DIRNAME}',"${PACKAGE_DISTROOT}", \
251 -e s,'$${PACKAGE_DISTNAME}',"${PACKAGE_DISTNAME}", \
252 -e s,'^# *cut:',, $< > $@
254 # The following rules use sed and awk to match the RCS Id keyword;
255 # we define and use the following macro, in the form "$(DOLLAR)Id:",
256 # to avoid unwanted substitution on CVS checkout.
260 # The following rule provides a mechanism for generating a composite from
261 # README, INSTALL and NEWS, for use as an on-line package description.
263 readme.txt: gendoc.combined.sed readme.txt.tag readme.txt.in
264 sed s,'$(DOLLAR)Id:.*',"`cat $@.tag`", $@.in > $@
265 echo '$$Document: $@ $$: end of file' >> $@
266 rm -f gendoc.combined.sed $@.*
268 # There should be a new generation of readme.txt for each package release;
269 # since each release should also include an updated NEWS file; we adopt the
270 # ID tag-line from NEWS.in, as most the appropriate template for generation
271 # of a corresponding tag-line for readme.in
273 readme.txt.tag: NEWS.in
274 awk '/\$(DOLLAR)Id:/{ $$2 = "readme.txt\\,v"; print }' $^ > $@
276 # The tag-line generated by the preceding rule may then be substituted, by
277 # the primary readme.txt generation rule above, into the document template
278 # generated by the following rule
280 readme.txt.in: README.in NEWS.in INSTALL.in
282 for input in $^; do \
283 sed -f gendoc.combined.sed $$input | $(NROFF) >> $@; \
286 # Workspace clean-up...
289 rm -f *.$(OBJEXT) *.d *.dll $(BIN_PROGRAMS) $(LIBEXEC_PROGRAMS)
292 rm -f config.* version.c
294 maintainer-clean: distclean
295 rm -f README NEWS INSTALL readme.txt Makefile pkginfo.c
296 rm -f *-$(PACKAGE_DISTVERSION)-*.tar.* *-$(PACKAGE_DISTVERSION)-*.zip
297 rm -rf ${PACKAGE_DISTROOT} staged ${srcdir}/autom4te.cache
299 # $RCSfile$: end of file