summaryrefslogtreecommitdiff
path: root/Makefile.in
blob: b90597e29e5e0cee19579ff74aa329d5a0699d44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
#
# "$Id: Makefile.in 827 2010-12-29 17:32:40Z mike $"
#
#   Makefile for the ESP Package Manager (EPM).
#
#   Copyright 1999-2010 by Easy Software Products, all rights reserved.
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2, or (at your option)
#   any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#

#
# Programs...
#

AR		=	@AR@
CC		=	@CC@
CHMOD		=	@CHMOD@
CP		=	@CP@
CXX		=	@CXX@
FLTKCONFIG	=	@FLTKCONFIG@
MKDIR		=	@MKDIR@ -p
RANLIB		=	@RANLIB@
RM		=	@RM@ -f
SHELL		=	/bin/sh
STRIP		=	@STRIP@


#
# Program options...
#
# OPTIM   defines the common compiler optimization/debugging options.
#

ARFLAGS		=	@ARFLAGS@
ARCHFLAGS	=	@ARCHFLAGS@
CFLAGS		=	$(ARCHFLAGS) @CFLAGS@ $(OPTIM)
CXXFLAGS	=	$(ARCHFLAGS) @CXXFLAGS@ $(OPTIM)
CPPFLAGS	=	@CPPFLAGS@
GUILIBS		=	@GUILIBS@
LDFLAGS		=	$(ARCHFLAGS) @LDFLAGS@ $(OPTIM)
LIBS		=	@LIBS@
OPTIM		=	@OPTIM@


#
# Directories...
#

bindir		=	@bindir@
datadir		=	@datadir@
datarootdir	=	@datarootdir@
docdir		=	@docdir@
exec_prefix	=	@exec_prefix@
mandir		=	@mandir@
prefix		=	@prefix@
libdir		=	@libdir@
srcdir		=	@srcdir@

VPATH		=	$(srcdir)


#
# Rules...
#

.SUFFIXES:	.c .cxx .h .o
.c.o:
	$(CC) $(CFLAGS) $(CPPFLAGS) -I. -I$(srcdir) -c $<
.cxx.o:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -I. -I$(srcdir) -c $<


#
# Targets...
#

TARGETS		=	libepm.a \
			epm \
			epminstall \
			mkepmlist \
			@GUIS@
EPM_OBJS	=	aix.o \
			bsd.o \
			deb.o \
			dist.o \
			file.o \
			inst.o \
			osx.o \
			pkg.o \
			portable.o \
			qprintf.o \
			rpm.o \
			run.o \
			setld.o \
			slackware.o \
			snprintf.o \
			string.o \
			support.o \
			swinstall.o \
			tar.o
SETUP_OBJS	=	setup.o \
			setup2.o \
			gui-common.o
UNINST_OBJS	=	uninst.o \
			uninst2.o \
			gui-common.o
OBJS		=	epm.o \
			$(EPM_OBJS) \
			epminstall.o \
			mkepmlist.o \
			$(SETUP_OBJS) \
			$(UNINST_OBJS)


#
# Make all targets...
#

all:	$(TARGETS) Makefile config.h


#
# Clean all object files...
#

clean:
	$(RM) $(OBJS)
	$(RM) $(TARGETS)


#
# Clean all object files and generated files...
#

distclean:
	$(RM) $(OBJS)
	$(RM) $(TARGETS)
	$(RM) config.cache config.h config.log config.status
	$(RM) Makefile doc/Makefile macosx/Makefile
	$(RM) epm.list


#
# Run the clang.llvm.org static code analysis tool on the C sources.
#

.PHONY: clang clang-changes
clang:
	$(RM) -r clang
	scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all
clang-changes:
	scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all


#
# Install all targets...
#

install: all @INSTALL_GUIS@ @INSTALL_OSX@
	@echo Installing EPM programs in $(bindir)
	-$(MKDIR) $(bindir)
	$(RM) $(bindir)/epm
	$(CP) epm $(bindir)
	$(STRIP) $(bindir)/epm
	$(RM) $(bindir)/epminstall
	$(CP) epminstall $(bindir)
	$(STRIP) $(bindir)/epminstall
	$(RM) $(bindir)/mkepmlist
	$(CP) mkepmlist $(bindir)
	@echo Installing EPM manpages in $(mandir)/man1
	-$(MKDIR) $(mandir)/man1
	$(RM) $(mandir)/man1/epm.1
	$(CP) $(srcdir)/doc/epm.man $(mandir)/man1/epm.1
	$(RM) $(mandir)/man1/epminstall.1
	$(CP) $(srcdir)/doc/epminstall.man $(mandir)/man1/epminstall.1
	$(RM) $(mandir)/man1/mkepmlist.1
	$(CP) $(srcdir)/doc/mkepmlist.man $(mandir)/man1/mkepmlist.1
	$(RM) $(mandir)/man1/setup.1
	$(CP) $(srcdir)/doc/setup.man $(mandir)/man1/setup.1
	@echo Installing EPM manpages in $(mandir)/man5
	-$(MKDIR) $(mandir)/man5
	$(RM) $(mandir)/man5/epm.list.5
	$(CP) $(srcdir)/doc/epm.list.man $(mandir)/man5/epm.list.5
	$(RM) $(mandir)/man5/setup.types.5
	$(CP) $(srcdir)/doc/setup.types.man $(mandir)/man5/setup.types.5
	@echo Installing EPM documentation in $(docdir)
	-$(MKDIR) $(docdir)
	$(RM) $(docdir)/COPYING
	$(CP) $(srcdir)/COPYING $(docdir)
	$(RM) $(docdir)/README
	$(CP) $(srcdir)/README $(docdir)
	$(RM) $(docdir)/epm-book.html
	$(CP) $(srcdir)/doc/epm-book.html $(docdir)

install-guis:	setup uninst
	@echo Installing EPM setup/uninst in $(libdir)/epm
	$(RM) -r $(libdir)/epm
	-$(MKDIR) $(libdir)/epm
	$(CP) setup $(libdir)/epm
	-$(STRIP) $(libdir)/epm/setup
	$(CP) uninst $(libdir)/epm
	-$(STRIP) $(libdir)/epm/uninst

install-osx:
	@echo Installing EPM OSX data files in $(datadir)/epm
	$(RM) -r $(datadir)/epm
	-$(MKDIR) $(datadir)/epm
	$(CP) macosx/setup.icns $(datadir)/epm
	$(CP) macosx/setup.info $(datadir)/epm
	$(CP) macosx/uninst.icns $(datadir)/epm
	$(CP) macosx/uninst.info $(datadir)/epm


#
# Uninstall EPM...
#

uninstall:
	@echo Uninstalling EPM programs from $(bindir)
	$(RM) $(bindir)/epm
	$(RM) $(bindir)/epminstall
	$(RM) $(bindir)/mkepmlist
	@echo Uninstalling EPM manpages from $(mandir)/man1
	$(RM) $(mandir)/man1/epm.1
	$(RM) $(mandir)/man1/epminstall.1
	$(RM) $(mandir)/man1/mkepmlist.1
	$(RM) $(mandir)/man1/setup.1
	@echo Uninstalling EPM manpages from $(mandir)/man5
	$(RM) $(mandir)/man5/epm.list.5
	$(RM) $(mandir)/man5/setup.types.5
	@echo Uninstalling EPM documentation from $(docdir)
	$(RM) -r $(docdir)
	@echo Uninstalling EPM setup/uninstall from $(libdir)/epm
	$(RM) -r $(libdir)/epm
	@echo Uninstalling EPM OSX data files from $(datadir)/epm
	$(RM) -r $(datadir)/epm


#
# Makefile
#

Makefile:	Makefile.in configure
	if test -f config.status; then \
		./config.status --recheck; \
		./config.status; \
	else \
		./configure; \
	fi
	touch config.h


#
# config.h
#

config.h:	config.h.in configure
	if test -f config.status; then \
		./config.status --recheck; \
		./config.status; \
	else \
		./configure; \
	fi
	touch config.h


#
# Test EPM...
#

test:	$(TARGETS)
	@echo Starting portable distribution build test...
	@if ./epm -vv epm >test.log; then \
		echo Portable distribution build test PASSED.; \
	else \
		echo Portable distribution build test FAILED.; \
		cat test.log; \
	fi
	@echo Starting native distribution build test...
	@if ./epm -vv -s doc/epmlogo.tif -f native epm >test.log; then \
		echo Native distribution build test PASSED.; \
	else \
		echo Native distribution build test FAILED.; \
		cat test.log; \
	fi
	$(RM) test.log


#
# Make distributions using EPM...
#

aix: $(TARGETS)
	./epm -f aix -v epm

bsd: $(TARGETS)
	./epm -f bsd -v epm

slackware: $(TARGETS)
	./epm -f slackware -v epm

deb: $(TARGETS)
	./epm -f deb -v epm

gui portable: $(TARGETS)
	./epm -v -s doc/epmlogo.gif --setup-program setup \
		--uninstall-program uninst --data-dir macosx epm

inst tardist: $(TARGETS)
	./epm -f tardist -v epm

lsb rpm: $(TARGETS)
	./epm -f $@ -v -s doc/epmlogo.gif --setup-program setup \
		--uninstall-program uninst --data-dir macosx epm

pkg: $(TARGETS)
	./epm -f pkg -v epm

native: $(TARGETS)
	./epm -f native -v epm

osx: $(TARGETS)
	./epm -f osx -v -s doc/epmlogo.tif epm

swinstall depot: $(TARGETS)
	./epm -f depot -v epm


#
# libepm.a
#

libepm.a:	$(EPM_OBJS)
	$(RM) libepm.a
	$(AR) $(ARFLAGS) libepm.a $(EPM_OBJS)
	$(RANLIB) libepm.a

$(EPM_OBJS):	epm.h epmstring.h


#
# epm
#

epm:	epm.o $(EPM_OBJS)
	$(CC) $(LDFLAGS) -o epm epm.o libepm.a $(LIBS)

epm.o:	epm.h epmstring.h


#
# epminstall
#

epminstall:	epminstall.o libepm.a
	$(CC) $(LDFLAGS) -o epminstall epminstall.o libepm.a $(LIBS)

epminstall.o:	epm.h epmstring.h


#
# mkepmlist
#

mkepmlist:	mkepmlist.o libepm.a
	$(CC) $(LDFLAGS) -o mkepmlist mkepmlist.o libepm.a $(LIBS)

mkepmlist.o:	epm.h epmstring.h


#
# setup
#

setup:	$(SETUP_OBJS) libepm.a
	$(CXX) $(LDFLAGS) -o setup $(SETUP_OBJS) libepm.a $(GUILIBS) $(LIBS)

setup.o:	setup.h gui-common.h epmstring.h
setup2.o:	setup.h gui-common.h epmstring.h
gui-common.o:	gui-common.h


#
# uninst
#

uninst:	$(UNINST_OBJS) libepm.a
	$(CXX) $(LDFLAGS) -o uninst $(UNINST_OBJS) libepm.a $(GUILIBS) $(LIBS)

uninst.o:	uninst.h epmstring.h gui-common.h
uninst2.o:	uninst.h epmstring.h gui-common.h
gui-common.o:	gui-common.h


#
# Common dependencies...
#

$(OBJS):	Makefile config.h


#
# End of "$Id: Makefile.in 827 2010-12-29 17:32:40Z mike $".
#