This repository has been archived by the owner on Oct 19, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Makefile.in
294 lines (239 loc) · 6.61 KB
/
Makefile.in
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
#
# Makefile for the ESP Package Manager (EPM).
#
# Copyright © 1999-2020 by Michael R Sweet
# 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@
CODE_SIGN = @CODE_SIGN@
CP = @CP@
CXX = @CXX@
FLTKCONFIG = @FLTKCONFIG@
INSTALL = @INSTALL@
MKDIR = @MKDIR@ -p
RANLIB = @RANLIB@
RM = @RM@ -f
SHELL = /bin/sh
STRIP = @STRIP@
# Program options...
ARFLAGS = @ARFLAGS@
ARCHFLAGS = @ARCHFLAGS@
ASAN_OPTIONS = leak_check_at_exit=false
CFLAGS = $(ARCHFLAGS) @CFLAGS@ $(OPTIM)
CODESIGN_IDENTITY = -
CPPFLAGS = @CPPFLAGS@
CSFLAGS = -s "$(CODESIGN_IDENTITY)" --timestamp @CSFLAGS@
CXXFLAGS = $(ARCHFLAGS) @CXXFLAGS@ $(OPTIM)
GUILIBS = @GUILIBS@
LDFLAGS = $(ARCHFLAGS) @LDFLAGS@ $(OPTIM)
LIBS = @LIBS@
OPTIM = @OPTIM@
# Directories...
bindir = @bindir@
datadir = @datadir@
datarootdir = @datarootdir@
exec_prefix = @exec_prefix@
includedir = @includedir@
infodir = @infodir@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
privateinclude = @privateinclude@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
top_srcdir = @top_srcdir@
BUILDROOT = $(DSTROOT)$(RPM_BUILD_ROOT)$(DESTDIR)
VPATH = $(srcdir)
# Rules...
.SILENT:
.SUFFIXES: .c .cxx .h .o
.c.o:
echo Compiling $<...
$(CC) $(CFLAGS) $(CPPFLAGS) -I. -I$(srcdir) -c $<
.cxx.o:
echo Compiling $<...
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -I. -I$(srcdir) -c $<
# Targets...
TARGETS = libepm.a \
epm \
epminstall \
mkepmlist \
@GUIS@
EPM_OBJS = bsd.o \
deb.o \
dist.o \
file.o \
macos.o \
portable.o \
qprintf.o \
rpm.o \
run.o \
snprintf.o \
string.o \
support.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 generated files...
clean:
$(RM) $(OBJS)
$(RM) $(TARGETS)
# Clean all generated and configuration files...
distclean:
$(RM) $(OBJS)
$(RM) $(TARGETS)
$(RM) config.cache config.h config.log config.status
$(RM) Makefile doc/Makefile
$(RM) epm.list
# Install all targets...
install: all @INSTALL_GUIS@ @INSTALL_OSX@
echo Installing EPM programs in $(BUILDROOT)$(bindir)
$(INSTALL) -d -m 755 $(BUILDROOT)$(bindir)
for file in epm epminstall mkepmlist; do \
$(INSTALL) -c -m 755 $$file $(BUILDROOT)$(bindir); \
done
(cd doc; $(MAKE) $(MFLAGS) install)
install-guis: setup uninst
echo Installing EPM setup/uninst in $(BUILDROOT)$(libdir)/epm
$(INSTALL) -d -m 755 $(BUILDROOT)$(libdir)/epm
for file in setup uninst; do \
$(INSTALL) -c -m 755 $$file $(BUILDROOT)$(libdir)/epm; \
done
install-macos:
echo Installing EPM macOS data files in $(BUILDROOT)$(datadir)/epm
$(INSTALL) -d -m 755 $(BUILDROOT)$(datadir)/epm
$(INSTALL) -c -m 644 default.icns $(BUILDROOT)$(datadir)/epm
# Uninstall all targets...
uninstall:
echo Uninstalling EPM programs from $(BUILDROOT)$(bindir)
$(RM) $(BUILDROOT)$(bindir)/epm
$(RM) $(BUILDROOT)$(bindir)/epminstall
$(RM) $(BUILDROOT)$(bindir)/mkepmlist
echo Uninstalling EPM setup/uninstall from $(BUILDROOT)$(libdir)/epm
$(RM) -r $(BUILDROOT)$(libdir)/epm
echo Uninstalling EPM macOS data files from $(BUILDROOT)$(datadir)/epm
$(RM) -r $(BUILDROOT)$(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 default.png -f native \
--setup-program setup --uninstall-program uninst \
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 in different formats using EPM...
bsd: $(TARGETS)
./epm -f bsd -v epm
deb: $(TARGETS)
./epm -f deb -v epm
gui: $(TARGETS)
./epm -f portable -v -s default.png --setup-program setup \
--uninstall-program uninst --data-dir . epm
lsb macos portable rpm: $(TARGETS)
./epm -f $@ -v -s default.png --setup-program setup \
--uninstall-program uninst --data-dir . epm
native: $(TARGETS)
./epm -f native -v epm
# libepm.a
libepm.a: $(EPM_OBJS)
echo Archiving libepm.a...
$(RM) libepm.a
$(AR) $(ARFLAGS) libepm.a $(EPM_OBJS)
$(RANLIB) libepm.a
$(EPM_OBJS): epm.h epmstring.h
# epm
epm: epm.o libepm.a
echo Linking epm...
$(CC) $(LDFLAGS) -o epm epm.o libepm.a $(LIBS)
echo Code signing $@...
$(CODE_SIGN) $(CSFLAGS) -i org.msweet.epm.$@ $@
epm.o: epm.h epmstring.h
# epminstall
epminstall: epminstall.o libepm.a
echo Linking epminstall...
$(CC) $(LDFLAGS) -o epminstall epminstall.o libepm.a $(LIBS)
echo Code signing $@...
$(CODE_SIGN) $(CSFLAGS) -i org.msweet.epm.$@ $@
epminstall.o: epm.h epmstring.h
# mkepmlist
mkepmlist: mkepmlist.o libepm.a
echo Linking mkepmlist...
$(CC) $(LDFLAGS) -o mkepmlist mkepmlist.o libepm.a $(LIBS)
echo Code signing $@...
$(CODE_SIGN) $(CSFLAGS) -i org.msweet.epm.$@ $@
mkepmlist.o: epm.h epmstring.h
# setup (GUI)
setup: $(SETUP_OBJS) libepm.a
echo Linking setup...
$(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 (GUI)
uninst: $(UNINST_OBJS) libepm.a
echo Linking uninst...
$(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