OSDN Git Service

Update help text to document package version selection capability.
[mingw/mingw-get.git] / Makefile.in
1 # @configure_input@
2 #
3 # $Id$
4
5 PACKAGE_TARNAME = @PACKAGE_TARNAME@
6 PACKAGE_VERSION = @PACKAGE_VERSION@
7
8 # Written by Keith Marshall <keithmarshall@users.sourceforge.net>
9 # Copyright (C) 2009, 2010, 2011, 2012, MinGW Project
10 #
11 #
12 # Makefile template for mingw-get
13 #
14 #
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.
20 #
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.
27 #
28 PACKAGE_SUBSYSTEM = @host_os@
29
30 srcdir = @srcdir@
31 abs_top_srcdir = @abs_top_srcdir@
32
33 DEBUGLEVEL = @DEBUGLEVEL@
34
35 vpath %.ico @srcdir@/icons
36 VPATH = @top_srcdir@/src:@top_srcdir@/src/pkginfo:@top_srcdir@/tinyxml
37
38 CC = @CC@
39 CFLAGS = @CFLAGS@
40 CPPFLAGS = @CPPFLAGS@ -D DEBUGLEVEL=$(DEBUGLEVEL) $(INCLUDES)
41
42 CXX = @CXX@
43 CXXFLAGS = $(CFLAGS)
44
45 INCLUDES = -I ${srcdir}/src -I ${srcdir}/src/pkginfo -I ${srcdir}/tinyxml
46
47 LEX = @LEX@
48
49 AR = @AR@
50 ARFLAGS = @ARFLAGS@
51
52 WINDRES = @WINDRES@
53
54 OBJEXT = @OBJEXT@
55 EXEEXT = @EXEEXT@
56
57 LDFLAGS = @LDFLAGS@
58 LIBS = -Wl,-Bstatic -llua -lz -lbz2 -llzma -Wl,-Bdynamic -lwininet
59
60 CORE_DLL_OBJECTS  =  climain.$(OBJEXT) pkgshow.$(OBJEXT) dmh.$(OBJEXT) \
61    pkgbind.$(OBJEXT) pkginet.$(OBJEXT) pkgstrm.$(OBJEXT) pkgname.$(OBJEXT) \
62    pkgexec.$(OBJEXT) pkgfind.$(OBJEXT) pkginfo.$(OBJEXT) pkgspec.$(OBJEXT) \
63    pkgopts.$(OBJEXT) sysroot.$(OBJEXT) pkghash.$(OBJEXT) pkgkeys.$(OBJEXT) \
64    pkgdeps.$(OBJEXT) pkgreqs.$(OBJEXT) pkginst.$(OBJEXT) pkgunst.$(OBJEXT) \
65    tarproc.$(OBJEXT) xmlfile.$(OBJEXT) keyword.$(OBJEXT) vercmp.$(OBJEXT) \
66    tinyxml.$(OBJEXT) tinystr.$(OBJEXT) tinyxmlparser.$(OBJEXT) \
67    mkpath.$(OBJEXT)  tinyxmlerror.$(OBJEXT)
68
69 script_srcdir = ${srcdir}/scripts/libexec
70
71 BIN_PROGRAMS = pkginfo$(EXEEXT) mingw-get$(EXEEXT)
72 LIBEXEC_PROGRAMS = gui$(EXEEXT) lastrites$(EXEEXT)
73 LIBEXEC_SCRIPTS = ${script_srcdir}/setup.lua ${script_srcdir}/wsh.lua \
74    ${script_srcdir}/shlink.js ${script_srcdir}/unlink.js
75 LIBEXEC_DATA = mingw-get-0.dll
76
77 all: $(BIN_PROGRAMS) $(LIBEXEC_PROGRAMS) $(LIBEXEC_DATA)
78
79 pkginfo$(EXEEXT):  driver.$(OBJEXT) pkginfo.$(OBJEXT)
80         $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $+
81
82 mingw-get$(EXEEXT): clistub.$(OBJEXT) version.$(OBJEXT) getopt.$(OBJEXT)
83         $(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $+
84
85 GUI_LDFLAGS = -mwindows $(LDFLAGS)
86
87 # FIXME: the following is a Q&D kludge, to assign my choice of icon
88 # to the GUI mode executable stub.  Eventually, this will need to be
89 # assigned within a resource definition file, but for the time being,
90 # besides providing a notification that the GUI is not yet available,
91 # the stub serves only to illustrate mingw-get's shortcut creation
92 # capability; thus, this simple hack will suffice.
93 #
94 %.$(OBJEXT): %.ico
95         echo $* ICON $*.ico | $(WINDRES) -I ${srcdir}/icons -o $@
96 #
97 gui$(EXEEXT): guimain.$(OBJEXT) pkgicon.$(OBJEXT)
98         $(CXX) -o $@ $(CXXFLAGS) $(GUI_LDFLAGS) $+
99
100 lastrites$(EXEEXT): rites.$(OBJEXT)
101         $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $+
102
103 mingw-get-0.dll: $(CORE_DLL_OBJECTS)
104         $(CXX) -shared -o $@ $(CXXFLAGS) $(LDFLAGS) $+ $(LIBS)
105
106 # Compilation and dependency tracking...
107 #
108 DEPFLAGS = -MM -MP -MD
109 sinclude *.d
110
111 %.$(OBJEXT): %.c
112         $(CC) $(DEPFLAGS) $(CPPFLAGS) $(CFLAGS) $<
113         $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
114
115 %.$(OBJEXT): %.cpp
116         $(CXX) $(DEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $<
117         $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
118
119 # Installation tools and directory paths...
120 #
121 mkinstalldirs = @MKDIR_P@
122
123 prefix = @prefix@
124 exec_prefix = @exec_prefix@
125 localstatedir = @localstatedir@
126 libexecdir = @libexecdir@
127 bindir = @bindir@
128
129 PACKAGE_CONFIG_DIR = ${localstatedir}/lib/${PACKAGE_TARNAME}/data
130
131 INSTALL = @INSTALL@
132 INSTALL_DATA = @INSTALL_DATA@
133 INSTALL_PROGRAM = @INSTALL_PROGRAM@
134 INSTALL_SCRIPT = @INSTALL_SCRIPT@
135
136 STRIP = @STRIP@
137 LN_S = @LN_S@
138
139 # Installation rules...
140 #
141 installdirs:
142         $(mkinstalldirs) ${bindir}
143         $(mkinstalldirs) ${libexecdir}/${PACKAGE_TARNAME}
144         $(mkinstalldirs) ${PACKAGE_CONFIG_DIR}
145
146 install: installdirs install-profile
147         for image in $(BIN_PROGRAMS); do \
148           $(INSTALL_PROGRAM) $$image ${bindir}; \
149           done
150         for image in $(LIBEXEC_PROGRAMS); do \
151           $(INSTALL_PROGRAM) $$image ${libexecdir}/${PACKAGE_TARNAME}; \
152           done
153         for image in $(LIBEXEC_DATA) $(LIBEXEC_SCRIPTS); do \
154           $(INSTALL_DATA) $$image ${libexecdir}/${PACKAGE_TARNAME}; \
155           done
156
157 install-profile:
158         $(INSTALL_DATA) ${srcdir}/xml/profile.xml \
159           ${PACKAGE_CONFIG_DIR}/defaults.xml
160
161 install-strip: install
162         for image in $(BIN_PROGRAMS); do \
163           $(STRIP) ${bindir}/$$image; \
164           done
165         for image in $(LIBEXEC_PROGRAMS) $(LIBEXEC_DATA); do \
166           $(STRIP) ${libexecdir}/${PACKAGE_TARNAME}/$$image; \
167           done
168
169 # Packaging and distribution...
170 #
171 LICENCE_FILES = README COPYING
172 SRCDIST_FILES = $(LICENCE_FILES) ChangeLog NEWS INSTALL \
173   aclocal.m4 configure.ac configure Makefile.in version.c.in
174
175 SRCDIST_SUBDIRS = build-aux icons m4 src src/pkginfo srcdist-doc \
176   scripts/libexec tinyxml xml
177
178 # The names of distributed pacakge archive files incorporate version
179 # information, derived from PACKAGE_VERSION; this is decomposed, so that
180 # the PACKAGE_SUBSYSTEM may be interposed between the principal version
181 # number and any qualifying suffix, which specifies development status.
182 # Additionally, the package maintainer may specify, (at `make dist' time),
183 # a SNAPSHOT qualifier; if specified, this will be appended, (literally),
184 # to the principal version number component of the package version number,
185 # as it appears in the distributed archive file names.
186 #
187 PACKAGE_DISTROOT = $(PACKAGE_TARNAME)-$(PACKAGE_ROOTVERSION)
188 PACKAGE_ROOTVERSION = `echo $(PACKAGE_VERSION) | sed 's,-[^0-9].*,,'`
189 PACKAGE_DISTVERSION = `echo $(PACKAGE_VERSION)-$(PACKAGE_SUBSYSTEM) | sed \
190   -e 's,-[^0-9],-$(PACKAGE_SUBSYSTEM)&,' \
191   -e 's,\(-$(PACKAGE_SUBSYSTEM).*\)-$(PACKAGE_SUBSYSTEM),\1,' \
192   -e 's,-$(PACKAGE_SUBSYSTEM),$(SNAPSHOT)&,'`
193 PACKAGE_DISTNAME = $(PACKAGE_TARNAME)-$(PACKAGE_DISTVERSION)
194
195 dist: srcdist bindist readme.txt
196
197 # Specify default compression command, and associated file name extension,
198 # for creation and identification of packaged tar archives.
199 #
200 TARZIP = xz
201 TAREXT = tar.$(TARZIP)
202
203 bindist: all licdist
204         rm -rf staged
205         $(MAKE) --no-print-directory prefix=`pwd`/staged install-strip
206         cd staged; tar chf - bin/pkginfo$(EXEEXT) | $(TARZIP) -c > \
207           ../pkginfo-$(PACKAGE_DISTVERSION)-bin.$(TAREXT)
208         rm staged/bin/pkginfo$(EXEEXT)
209         cd staged; tar chf - * | $(TARZIP) -c > \
210           ../$(PACKAGE_DISTNAME)-bin.$(TAREXT)
211         cd staged; zip -r ../$(PACKAGE_DISTNAME)-bin.zip *
212         rm -rf staged
213
214 licdist:
215         rm -rf share
216         $(mkinstalldirs) ./share/doc/${PACKAGE_TARNAME}
217         cd ./share/doc/${PACKAGE_TARNAME}; for file in $(LICENCE_FILES); \
218           do test -f ${abs_top_srcdir}/$$file \
219             && $(LN_S) ${abs_top_srcdir}/$$file . \
220             || $(LN_S) ${CURDIR}/$$file .; \
221           done
222         tar chf - share | $(TARZIP) -c > $(PACKAGE_DISTNAME)-lic.$(TAREXT)
223         rm -rf share
224
225 srcdist: srcdist-doc
226         rm -rf ${PACKAGE_DISTROOT} && mkdir ${PACKAGE_DISTROOT}
227         cd ${PACKAGE_DISTROOT}; for file in $(SRCDIST_FILES); do \
228           test -f ${abs_top_srcdir}/$$file \
229             && $(LN_S) ${abs_top_srcdir}/$$file . \
230             || $(LN_S) ../$$file .; \
231           done
232         for dir in $(SRCDIST_SUBDIRS); do \
233           $(mkinstalldirs) ${PACKAGE_DISTROOT}/$$dir \
234           && cd ${PACKAGE_DISTROOT}/$$dir; \
235           for file in `cd ${abs_top_srcdir}/$$dir && echo *`; do \
236             if test -f ${abs_top_srcdir}/$$dir/$$file; then \
237               $(LN_S) ${abs_top_srcdir}/$$dir/$$file .; \
238             fi; \
239           done; \
240         cd ${CURDIR}; done
241         cd ${PACKAGE_DISTROOT}/src/pkginfo; $(LN_S) ${CURDIR}/pkginfo.c .
242         tar chf - ${PACKAGE_DISTROOT} | $(TARZIP) -c > \
243           ${PACKAGE_DISTNAME}-src.$(TAREXT)
244         rm -rf ${PACKAGE_DISTROOT}
245
246 # README, INSTALL and NEWS files to be included in the source distribution
247 # are generated on demand, as indirect side effects of a set of phoney goals
248 # so that they are always regenerated for each distribution, from templates
249 # in srcdist-doc so that we can make them version specific.
250 #
251 vpath %.in ${srcdir}/srcdist-doc
252 srcdist-doc: README.dist NEWS.dist INSTALL.dist
253
254 # We need to ensure that, when we invoke nroff, the generated output
255 # will be suited to an ASCII class of typesetter; without the -Tascii
256 # option, GNU nroff will substitute Unicode hyphens (u2010) in place
257 # of ASCII hyphens (code 45).
258 #
259 NROFF = nroff -Tascii
260
261 %.dist: %.in gendoc.simple.sed
262         sed -f gendoc.simple.sed $< | $(NROFF) > $*
263
264 %.simple.sed: %.sed.in
265         sed -e s,'$${PACKAGE_DIRNAME}',"${PACKAGE_DISTROOT}", \
266             -e s,'$${PACKAGE_DISTNAME}',"${PACKAGE_DISTNAME}", $< > $@
267
268 %.combined.sed: %.sed.in
269         sed -e s,'$${PACKAGE_DIRNAME}',"${PACKAGE_DISTROOT}", \
270             -e s,'$${PACKAGE_DISTNAME}',"${PACKAGE_DISTNAME}", \
271             -e s,'^# *cut:',, $< > $@
272
273 # The following rules use sed and awk to match the RCS Id keyword;
274 # we define and use the following macro, in the form "$(DOLLAR)Id:",
275 # to avoid unwanted substitution on CVS checkout.
276 #
277 DOLLAR = $$
278
279 # The following rule provides a mechanism for generating a composite from
280 # README, INSTALL and NEWS, for use as an on-line package description.
281 #
282 readme.txt: gendoc.combined.sed readme.txt.tag readme.txt.in
283         sed s,'$(DOLLAR)Id:.*',"`cat $@.tag`", $@.in > $@
284         echo '$$Document: $@ $$: end of file' >> $@
285         rm -f gendoc.combined.sed $@.*
286
287 # There should be a new generation of readme.txt for each package release;
288 # since each release should also include an updated NEWS file; we adopt the
289 # ID tag-line from NEWS.in, as most the appropriate template for generation
290 # of a corresponding tag-line for readme.in
291 #
292 readme.txt.tag: NEWS.in
293         awk '/\$(DOLLAR)Id:/{ $$2 = "readme.txt\\,v"; print }' $^ > $@
294
295 # The tag-line generated by the preceding rule may then be substituted, by
296 # the primary readme.txt generation rule above, into the document template
297 # generated by the following rule
298 #
299 readme.txt.in: README.in NEWS.in INSTALL.in
300         rm -f $@
301         for input in $^; do \
302           sed -f gendoc.combined.sed $$input | $(NROFF) >> $@; \
303           done
304
305 # Workspace clean-up...
306 #
307 clean:
308         rm -f *.$(OBJEXT) *.d *.dll $(BIN_PROGRAMS) $(LIBEXEC_PROGRAMS)
309
310 distclean: clean
311         rm -f config.* version.c
312
313 maintainer-clean: distclean
314         rm -f README NEWS INSTALL readme.txt Makefile pkginfo.c
315         rm -f *-$(PACKAGE_DISTVERSION)-*.tar.* *-$(PACKAGE_DISTVERSION)-*.zip
316         rm -rf ${PACKAGE_DISTROOT} staged ${srcdir}/autom4te.cache
317
318 # $RCSfile$: end of file