Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
554 lines (461 loc) · 19.4 KB
/
Copy pathMakefile
File metadata and controls
554 lines (461 loc) · 19.4 KB
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
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
# Top Level Makefile for Unicon
#
# Out-of-tree builds: run configure from a build directory (e.g. ../configure).
# TOPDIR is the source tree; UNICON_TOP_BUILDDIR is the configure/build directory (Makedefs,
# auto.h, config.status). Object files and binaries still go under TOPDIR in this phase; switch
# to UNICON_TOP_BUILDDIR paths when the build fully migrates out of the source tree.
srcdir = .
TOPDIR = .
export UNICON_TOP_BUILDDIR := $(CURDIR)
default: default_target
include Makedefs
name=unspecified
# Make sure no custom PATHs are set so the build doesn't get affected
# by other installations of unicon on the same system if they do exist
IPATH=
LPATH=
# get the current unicon dir name
unicwd=`basename \`pwd\``
default_target: allsrc
$(MAKE) -C $(TOPDIR)/ipl/lib
$(MAKE) -C $(TOPDIR)/uni
@if test -n "$(PLUGINS)"; then $(MAKE) -C $(TOPDIR)/plugins; fi
$(MAKE) docrule
$(MAKE) htmldocrule
@echo ============ Build Features ============ > unicon-features.log
# Binaries still under TOPDIR/bin until the tree emits them in UNICON_TOP_BUILDDIR.
$(TOPDIR)/bin/unicon -features >> unicon-features.log
@echo ======================================== >> unicon-features.log
@cat unicon-features.log
@echo "add $(shell cd $(TOPDIR) && pwd)/bin to your path or do \"make install\" to install Unicon on your system"
.PHONY: plugins update_rev doc config help seed-makedefs-uni
# Optional $(wildcard config.status): do not require config.status before it exists
# (e.g. debian/rules clean / dh_auto_clean runs make distclean without configuring).
# Do not copy Makedefs.in in that case: it still contains 13.3
# and would make the deb/rpm version string invalid.
Makedefs: $(srcdir)/Makedefs.in $(wildcard config.status)
@if test -f ./config.status; then \
$(SHELL) ./config.status Makedefs; \
else \
echo "Warning: config.status missing; Makedefs not regenerated. Run configure first." >&2; \
fi
# Makedefs.uni is configure output. Clean targets run before it exists, and
# an empty file turns "$(RMDIR) html" into a command named html. The template
# already defines RMDIR, unlike Makedefs.in which still has @PACKAGE_*@.
seed-makedefs-uni:
@if test ! -s Makedefs.uni; then cp $(srcdir)/Makedefs.uni.in Makedefs.uni; fi
update_rev:
@$(TOPDIR)/config/scripts/version.sh
#
# if you make any changes to configure.ac or aclocal.m4 run autoreconf -i
#
#configure: configure.ac aclocal.m4
# autoreconf -i
config: config.status
$(SHELL) ./config.status --recheck
help:
@echo
@echo "Unicon Build Instructions:"
@echo
@echo " Run the following configure and make commands"
@echo
@echo " UNIX/macOS:"
@echo " ./configure"
@echo " make"
@echo " Out-of-tree (build dir next to the source tree):"
@echo " mkdir build && cd build && ../configure && make"
@echo
@echo " Windows:"
@echo " sh configure --build=x86_64-w64-mingw32"
@echo " make"
@echo
##################################################################
#
# Default targets.
All: Icont Ilib Ibin
allsrc: Makedefs update_rev
$(MAKE) -C $(TOPDIR)/src
##################################################################
# needed especially for MacOS
.PHONY: Configure
WUnicon32:
sh configure --host=i686-w64-mingw32
WUnicon64:
sh configure --build=x86_64-w64-mingw32
INNOSETUP="C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
winbin WinInstaller:
@echo "#define PkgName \"$(PKG_TARNAME)\"" > $(TOPDIR)/config/win32/gcc/unicon_version.iss
@echo "#define AppVersion \"$(PKG_VERSION)\"" >> $(TOPDIR)/config/win32/gcc/unicon_version.iss
@echo "#define AppRevision \""`$(TOPDIR)/config/scripts/version.sh "revision"`"\"" \
>> $(TOPDIR)/config/win32/gcc/unicon_version.iss
@echo "#define PATCHSTR \"$(PATCHSTR)\"" >> $(TOPDIR)/config/win32/gcc/unicon_version.iss
@if test -n "$(GRAPHICS)"; then \
echo "#define WithGraphics" >> $(TOPDIR)/config/win32/gcc/unicon_version.iss; \
fi
$(INNOSETUP) $(TOPDIR)/config/win32/gcc/unicon.iss
##################################################################
#
# This is used utilize the ncurses-based tool to build Unicon
# make build name=xxxx
build:
if test "$(TERM)" = "dumb" ; then \
echo "No building on dumb terminals, use make Configure"; \
elif [ -f /usr/lib/libcurses.so ] ; then \
gcc $(TOPDIR)/src/common/build.c -lcurses -o build; \
./build $(name) ; \
rm build; \
elif [ -f /usr/include/curses.h ] ; then \
gcc $(TOPDIR)/src/common/build.c -lncurses -o build; \
./build $(name) ; \
rm build; \
else \
make Configure name=$(name); \
echo "No curses library was found for 'build', used 'make Configure name=$(name)'"; \
echo "If you want X11 graphics, run 'make X-Configure name=$(name)'"; \
fi
##################################################################
# Get the status information for a specific system.
Status:
@cat unicon-config.log
##################################################################
#
# Compilation and installation.
# The OO translator. Add a line for uni/iyacc if you modify the Unicon grammar
Unicon: Icont
cd $(TOPDIR)/ipl/lib; $(MAKE)
cd $(TOPDIR)/uni ; $(MAKE)
# The interpreter: icont and iconx.
Icont bin/icont:
$(MAKE) -C $(TOPDIR)/src Icont
# The compiler: rtt, the run-time system, and iconc.
Iconc Uniconc bin/iconc:
$(MAKE) -C $(TOPDIR)/src Iconc
# Common components.
Common:
$(MAKE) -C $(TOPDIR)/src Common
# The Icon program library.
Ilib: $(TOPDIR)/bin/icont
$(MAKE) -C $(TOPDIR)/ipl
Ibin: $(TOPDIR)/bin/icont
$(MAKE) -C $(TOPDIR)/ipl Ibin
# Common components.
plugins:
$(MAKE) -C $(TOPDIR)/plugins
# Documentation
docrule: $(UDOC)
doc:
$(MAKE) -C $(TOPDIR)/doc
# build full html documentation using unidoc
UBASE=$(shell cd $(TOPDIR) && pwd)
SBASE=$(UBASE)/uni
TBASE=$(UBASE)/doc/uni-api
# SRCDIRS is a space-separated list, SDIRS and LDIRS are comma-separated lists
SRCDIRS="$(SBASE)/progs $(SBASE)/gprogs $(SBASE)/lib $(UBASE)/ipl/procs $(UBASE)/progs $(UBASE)/gprogs $(SBASE)/unidoc"
SDIRS="$(SBASE)/progs,$(SBASE)/gprogs,$(SBASE)/lib,$(UBASE)/ipl/procs,$(UBASE)/progs,$(UBASE)/gprogs,$(SBASE)/unidoc"
LDIRS="$(TBASE)/lib"
basetitle="Unicon API "
cdir=$(shell cd $(TOPDIR) && pwd)
TD=$(TBASE)
title=$(basetitle)
htmldocrule: $(HTMLDOC)
htmldoc:
@echo ""
@echo " Building class library html documentation"
@echo ""
# $(MAKE) -C uni/unidoc htmldoc
mkdir -p ${TD}
$(TOPDIR)/bin/unidoc --title=$(title) --linkSrc --sourcePath="$(SDIRS)" --linkPath="$(LDIRS)" --resolve --targetDir=$(TD) "$(SRCDIRS)"
##################################################################
#
# Installation and packaging.
# Installation: "make Install dest=new-parent-directory"
ULROT=$(libdir)/unicon
RTDIR=$(ULROT)/rt
ULB=$(ULROT)/uni
UIPL=$(ULROT)/ipl
UPLUGINS=$(ULROT)/plugins/lib
INST=$(SHTOOL) install -c
F=*.{u,icn}
# runtime binaries, variants of iconx, icont, and iconc
RTbins=$(UNICONX)$(EXE) $(UNICONWX)$(EXE) $(UNICONT)$(EXE) $(UNICONWT)$(EXE) $(UNICONC)$(EXE)
ADDONbins=udb$(EXE) uprof$(EXE) unidep$(EXE) unidoc$(EXE) ui$(EXE) ivib$(EXE) ulsp$(EXE) uscribe$(EXE)
UTILbins=patchstr$(EXE) iyacc$(EXE) uflex$(EXE)
# rt.a and rt.h are installed with the runtime tree under $(libdir)/unicon/rt.
ALLbins=$(RTbins) unicon$(EXE) $(ADDONbins) $(UTILbins)
# binaries that should be signed after install, only needed on arm macOS for now
SIGNbins=$(RTbins) $(UTILbins)
Tdirs=$(DESTDIR)$(ULB) $(DESTDIR)$(UIPL) $(DESTDIR)$(UPLUGINS)
Udirs=lib 3d gui unidoc unidep xml parser ulsp uscribe
IPLdirs=lib incl gincl mincl procs
RTdirs=lib include include/uri
uninstall Uninstall:
# be conservative when deleting directories
@for d in $(DESTDIR)$(ULROT) $(DESTDIR)$(docdir) ; do \
echo "Uninstalling dir $$d ..."; \
rm -rf $$d; \
done
# delete the binaries we installed from unicon/bin
@for f in $(ALLbins); do \
echo "Uninstalling $(DESTDIR)$(bindir)/$$f ..."; \
rm -f $(DESTDIR)$(bindir)/$$f; \
done
# docs and man
@echo "Uninstalling $(DESTDIR)$(mandir)/man1/unicon.1 ..."
@rm -f $(DESTDIR)$(mandir)/man1/unicon.1
install Install:
# create all directories first
@for d in $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(docdir) $(DESTDIR)$(mandir)/man1 $(Tdirs) ; do \
(echo "Creating dir $$d") && (mkdir -p $$d); \
done
@for d in $(RTdirs); do \
(echo "Creating dir $(DESTDIR)$(RTDIR)/$$d") && (mkdir -p $(DESTDIR)$(RTDIR)/$$d); \
done
@for d in $(IPLdirs); do \
(echo "Creating dir $(DESTDIR)$(UIPL)/$$d") && (mkdir -p $(DESTDIR)$(UIPL)/$$d); \
done
@for d in $(Udirs); do \
(echo "Creating dir $(DESTDIR)$(ULB)/$$d") && (mkdir -p $(DESTDIR)$(ULB)/$$d); \
done
# install unicon/bin
@for f in $(ALLbins); do \
if test -f "$(TOPDIR)/bin/$$f"; then \
(echo "Installing bin/$$f") && ($(INST) $(TOPDIR)/bin/$$f $(DESTDIR)$(bindir)); \
if test "$$f" = $(UNICONT)$(EXE) ; then \
$(PATCHSTR) -DPatchStringHere $(DESTDIR)$(bindir)/$$f $(bindir)/$(UNICONX) || true; \
$(PATCHSTR) -DPatchUnirotHere $(DESTDIR)$(bindir)/$$f $(ULROT) || true; \
elif test "$$f" = $(UNICONWT)$(EXE) ; then \
$(PATCHSTR) -DPatchStringHere $(DESTDIR)$(bindir)/$$f $(bindir)/$(UNICONWX) || true; \
$(PATCHSTR) -DPatchUnirotHere $(DESTDIR)$(bindir)/$$f $(ULROT) || true; \
elif test "$$f" != $(PATCHSTRX) ; then \
$(PATCHSTR) -DPatchStringHere $(DESTDIR)$(bindir)/$$f $(bindir) || true; \
$(PATCHSTR) -DPatchUnirotHere $(DESTDIR)$(bindir)/$$f $(ULROT) || true; \
fi; \
fi; \
done
# install unicon/rt
@echo "Installing unicon/rt to $(DESTDIR)$(RTDIR) ..."
@$(INST) -m 644 $(TOPDIR)/rt/lib/* $(DESTDIR)$(RTDIR)/lib
@$(INST) -m 644 $(TOPDIR)/rt/include/*.h $(DESTDIR)$(RTDIR)/include
@$(INST) -m 644 $(TOPDIR)/rt/include/uri/*.h $(DESTDIR)$(RTDIR)/include/uri
# install unicon/ipl
@echo "Installing unicon/ipl to $(DESTDIR)$(UIPL) ..."
@$(INST) -m 644 $(TOPDIR)/ipl/lib/*.u $(DESTDIR)$(UIPL)/lib
@$(INST) -m 644 $(TOPDIR)/ipl/incl/*.icn $(DESTDIR)$(UIPL)/incl
@$(INST) -m 644 $(TOPDIR)/ipl/gincl/*.icn $(DESTDIR)$(UIPL)/gincl
@$(INST) -m 644 $(TOPDIR)/ipl/mincl/*.icn $(DESTDIR)$(UIPL)/mincl
@$(INST) -m 644 $(TOPDIR)/ipl/procs/*.icn $(DESTDIR)$(UIPL)/procs
# libcfunc.so is built into bin/ for in-tree runs. Packaged iconx looks
# for it in the uniroot directory added to FPATH.
@if test -f "$(TOPDIR)/bin/libcfunc.so"; then \
echo "Installing libcfunc.so to $(DESTDIR)$(ULROT)"; \
$(INST) $(TOPDIR)/bin/libcfunc.so $(DESTDIR)$(ULROT)/libcfunc.so; \
fi
# install unicon/uni
@for d in $(Udirs); do \
echo "Installing uni/$$d to $(DESTDIR)$(ULB)/$$d ..."; \
$(INST) -m 644 $(TOPDIR)/uni/$$d/*.* $(DESTDIR)$(ULB)/$$d; \
done
@echo "Installing uni/uscribe/themes to $(DESTDIR)$(ULB)/uscribe/themes ..."
@mkdir -p $(DESTDIR)$(ULB)/uscribe/themes/_shared
@$(INST) -m 644 $(TOPDIR)/uni/uscribe/themes/_shared/*.* $(DESTDIR)$(ULB)/uscribe/themes/_shared
@$(INST) -m 644 $(TOPDIR)/uni/uscribe/themes/README.md $(DESTDIR)$(ULB)/uscribe/themes
@for t in basic classic dark; do \
mkdir -p $(DESTDIR)$(ULB)/uscribe/themes/$$t/static; \
$(INST) -m 644 $(TOPDIR)/uni/uscribe/themes/$$t/theme.conf $(DESTDIR)$(ULB)/uscribe/themes/$$t; \
$(INST) -m 644 $(TOPDIR)/uni/uscribe/themes/$$t/static/*.* $(DESTDIR)$(ULB)/uscribe/themes/$$t/static; \
done
# plugins
@$(INST) -m 644 $(TOPDIR)/plugins/lib/*.* $(DESTDIR)$(UPLUGINS)/ || true
# docs and man
@echo "Installing $(DESTDIR)$(mandir)/man1/unicon.1 ..."
@$(INST) -m 644 $(TOPDIR)/doc/unicon/unicon.1 $(DESTDIR)$(mandir)/man1/
@$(INST) -m 644 $(TOPDIR)/README.md $(DESTDIR)$(docdir)
@echo "Installing $(DESTDIR)$(docdir) ..."
@$(INST) -m 644 $(TOPDIR)/doc/unicon/*.* $(DESTDIR)$(docdir)
# Sign code if we are running MacOS on Apple's processors
if test "$(UNICONHOST)" = "arm_64_macos"; then \
for f in $(SIGNbins); do \
echo signing $(DESTDIR)$(bindir)/$$f ; \
codesign -s - $(DESTDIR)$(bindir)/$$f ;\
done; \
fi
# Bundle up for binary distribution.
PKGDIR=$(PKG_TARNAME).$(PKG_VERSION)
Package:
rm -rf $(PKGDIR)
umask 002; $(MAKE) Install dest=$(PKGDIR)
tar cf - $(PKG_TARNAME).$(PKG_VERSION) | gzip -9 >$(PKG_TARNAME).$(PKG_VERSION).tgz
rm -rf $(PKGDIR)
distclean2: clean
@for d in $(SUBDIRS); do \
if test "$$d" != "."; then \
(cd $$d && $(MAKE) $@); \
fi; \
done
$(RM) Makefile config.status config.cache config.log
#Makefile: Makefile.in config.status
# cd $(top_srcdir) && $(SHELL) ./config.status
#config.status: $(srcdir)/configure
# $(SHELL) ./config.status --recheck
#MV=.0
VSUFFIX?=~prerelease
VV=$(PKG_VERSION)$(MV)
PKG_STRNAME=$(PKG_TARNAME)_$(VV)$(VSUFFIX)
UTAR=$(PKG_STRNAME).tar.gz
UTARORIG=$(PKG_STRNAME).orig.tar.gz
# CI sets UNICON_PKG_REV (run number, dot, short sha) so a development package
# sorts newer than the previous build. Local release builds leave it unset.
PKG_BUILDVER=$(VV)$(VSUFFIX)$(if $(UNICON_PKG_REV),+git$(UNICON_PKG_REV))
# CI sets UNICON_DEB_REV per suite (1~deb13u1, 1~ubuntu24.04.1, ...). The
# upstream version, and therefore the .orig.tar.gz name, stays the same so
# reprepro can store one orig for every suite. UNICON_DEB_CODENAME replaces
# UNRELEASED in the changelog so the .changes distribution matches the suite.
# Tarball, unicondist/, rpmbuild/ go under here (default: parent of repo). If the clone is at
# /unicon, .. is / (not writable): use e.g. DISTROOT=.dist or a path under your home directory.
DISTROOT ?= ..
dist: distclean update_rev
echo "Building $(UTAR)"
tar -czf $(DISTROOT)/$(UTAR) --exclude-vcs --exclude-backups \
--transform 's,^,$(PKG_TARNAME)/,' -C $(TOPDIR) .
publishdist: dist
scp $(DISTROOT)/$(UTAR) web.sf.net:/home/project-web/unicon/htdocs/download/
# Deb Section
udist=unicondist
SIGNKEYID=AB194DBF
SIGNOPT=-k$(SIGNKEYID)
deb: dist
mkdir -p $(DISTROOT)/$(udist)
mv $(DISTROOT)/$(UTAR) $(DISTROOT)/$(udist)/
cp $(DISTROOT)/$(udist)/$(UTAR) $(DISTROOT)/$(udist)/$(UTARORIG)
@echo unpacking $(DISTROOT)/$(udist)/$(UTAR)
cd $(DISTROOT)/$(udist) && tar -xf $(UTAR)
mv $(DISTROOT)/$(udist)/$(PKG_TARNAME) $(DISTROOT)/$(udist)/$(PKG_STRNAME)
@echo "To finish building the deb package, do"
@echo " cd $(DISTROOT)/$(udist)/$(PKG_STRNAME)"
@echo "Then run:"
@echo " debuild -us -uc"
debin: deb
src="$(DISTROOT)/$(udist)/$(PKG_STRNAME)"; \
if test -n "$(UNICON_PKG_REV)" || test -n "$$UNICON_DEB_REV" || test -n "$$UNICON_DEB_CODENAME"; then \
ver="$(PKG_BUILDVER)"; \
deb_rev="$${UNICON_DEB_REV:-1}"; \
sed -i "1s/([^)]*)/($${ver}-$${deb_rev})/" "$$src/debian/changelog"; \
if test -n "$${UNICON_DEB_CODENAME:-}"; then \
sed -i "1s/) UNRELEASED;/) $${UNICON_DEB_CODENAME};/" "$$src/debian/changelog"; \
fi; \
echo "Debian version $${ver}-$${deb_rev} ($${UNICON_DEB_CODENAME:-UNRELEASED})"; \
fi; \
if test -n "$(UNICON_PKG_REV)"; then \
ver="$(PKG_BUILDVER)"; \
dest="$(DISTROOT)/$(udist)/$(PKG_TARNAME)_$$ver"; \
mv "$$src" "$$dest"; \
mv "$(DISTROOT)/$(udist)/$(UTARORIG)" "$(DISTROOT)/$(udist)/$(PKG_TARNAME)_$$ver.orig.tar.gz"; \
src="$$dest"; \
fi; \
if test -n "$(UNICON_CONFIGURE_EXTRA)"; then \
printf '%s\n' "$(UNICON_CONFIGURE_EXTRA)" > "$$src/debian/configure-extra"; \
fi; \
case " $(UNICON_CONFIGURE_EXTRA) " in \
*" --disable-graphics "*) \
DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES:+$$DEB_BUILD_PROFILES }pkg.unicon.nographics"; \
export DEB_BUILD_PROFILES; \
;; \
esac; \
cd "$$src" && DEB_BUILD_MAINT_OPTIONS="$${DEB_BUILD_MAINT_OPTIONS:+$$DEB_BUILD_MAINT_OPTIONS }optimize=-lto" debuild -us -uc $(SIGNOPT) --lintian-opts --profile debian
ls -lh $(DISTROOT)/$(udist)/*.deb
debsrc: deb
cd $(DISTROOT)/$(udist)/$(PKG_STRNAME) && debuild -S $(SIGNOPT) --lintian-opts --profile debian
ls -lh $(DISTROOT)/$(udist)/$(PKG_TARNAME)_*.dsc
debsign:
cd $(DISTROOT)/$(udist) && debsign $(PKG_STRNAME)*.changes $(SIGNOPT)
launchpad:
cd $(DISTROOT)/$(udist) && dput unicon-ppa $(PKG_STRNAME)*_source.changes
# RPM section
rpmdir=rpmbuild
# Absolute, so rpmbuild --define _topdir still points here after the recipe cds into SPECS.
RPM_TOPDIR=$(abspath $(DISTROOT)/$(rpmdir))
rpm: dist
mkdir -p $(RPM_TOPDIR)/SOURCES
mkdir -p $(RPM_TOPDIR)/SPECS
cp $(TOPDIR)/rpm/unicon.spec $(RPM_TOPDIR)/SPECS
mv $(DISTROOT)/$(UTAR) $(RPM_TOPDIR)/SOURCES
@echo "To finish building the rpm package, do"
@echo " cd $(RPM_TOPDIR)/SPECS"
@echo "Then run:"
@echo " rpmbuild -ba $(RPM_DEFINES) unicon.spec"
# UNICON_CONFIGURE_EXTRA is passed to ./configure (for example --disable-graphics).
# An empty configure_extra define is an rpmbuild error, so omit it unless set.
RPM_WITH_GRAPHICS=$(if $(findstring --disable-graphics,$(UNICON_CONFIGURE_EXTRA)),0,1)
# autoconf accepts --disable-plugins and --enable-plugins=no. Both turn the
# library off. Match whole words so --disable-plugins=yes is not treated as off.
RPM_WITH_PLUGINS=$(if $(filter --disable-plugins --disable-plugins=no --enable-plugins=no,$(UNICON_CONFIGURE_EXTRA)),0,1)
RPM_DEFINES=--define "ver $(PKG_BUILDVER)" \
--define "tarball $(UTAR)" \
--define "_topdir $(RPM_TOPDIR)" \
$(if $(UNICON_CONFIGURE_EXTRA),--define "configure_extra $(UNICON_CONFIGURE_EXTRA)") \
--define "with_graphics $(RPM_WITH_GRAPHICS)" \
$(if $(filter 0,$(RPM_WITH_PLUGINS)),--without plugins)
rpmbin: rpm
cd $(RPM_TOPDIR)/SPECS && rpmbuild -ba $(RPM_DEFINES) unicon.spec
ls -lh $(RPM_TOPDIR)/RPMS/*/$(PKG_TARNAME)-*.rpm
rpmresume: rpm
cd $(RPM_TOPDIR)/SPECS && rpmbuild -bi --short-circuit $(RPM_DEFINES) unicon.spec
ls -lh $(RPM_TOPDIR)/RPMS/*/$(PKG_TARNAME)-*.rpm
rpmsrc: rpm
cd $(RPM_TOPDIR)/SPECS && rpmbuild -bs \
--define "ver $(PKG_BUILDVER)" \
--define "tarball $(UTAR)" \
--define "_topdir $(RPM_TOPDIR)" \
unicon.spec
ls -lh $(RPM_TOPDIR)/SRPMS/$(PKG_TARNAME)-*.src.rpm
##################################################################
#
# Tests.
Test Test-icont: ; cd $(TOPDIR)/tests; $(MAKE) Test
Samples Samples-icont: ; cd $(TOPDIR)/tests; $(MAKE) Samples
Test-iconc: ; cd $(TOPDIR)/tests; $(MAKE) Test-iconc
Samples-iconc: ; cd $(TOPDIR)/tests; $(MAKE) Samples-iconc
#################################################################
#
# Run benchmarks.
Benchmark:
$(MAKE) Benchmark-icont
Benchmark-iconc:
cd $(TOPDIR)/tests/bench; $(MAKE) benchmark-iconc
Benchmark-icont:
cd $(TOPDIR)/tests/bench; $(MAKE) benchmark-icont
##################################################################
#
# Clean-up.
#
# Out-of-tree: clean/distclean/Pure still recurse into $(TOPDIR) because artifacts currently
# live in the source tree, so "make clean" from a build directory cleans under the source tree.
# Revisit when objects and binaries are only written under UNICON_TOP_BUILDDIR.
#
# clean and Clean are one target, the GNU clean: delete what the build
# created, including executables and libraries. Configure output stays.
# Two checked-in ucode files are the exception. uni/unicon keeps
# unigram.u and idol.u because rebuilding them needs the translator
# they exist to build.
#
# distclean and Pure are one target, the GNU distclean: clean, then
# delete configure output. Pure is the older name for that.
.PHONY: clean Clean distclean Pure
clean Clean:
$(MAKE) seed-makedefs-uni
rm -rf icon.* $(TOPDIR)/bin/[A-Za-z]* $(TOPDIR)/lib/[a-z]*
cd $(TOPDIR)/uni; $(MAKE) Clean
cd $(TOPDIR)/ipl; $(MAKE) Clean
cd $(TOPDIR)/src; $(MAKE) Clean
cd $(TOPDIR)/tests; $(MAKE) Clean
cd $(TOPDIR)/plugins; $(MAKE) Clean
cd $(TOPDIR)/doc; $(MAKE) Clean
distclean Pure: clean
cd $(TOPDIR)/src; $(MAKE) Pure
cd $(TOPDIR)/tests; $(MAKE) distclean
rm -f $(TOPDIR)/src/common/rswitch.[csS]
$(RM) config.status config.cache config.log unicon-config.log
# rm -f \#*# *~ .#*
# rm -f */#*# */*~ */.#*
# rm -f */*/#*# */*/*~ */*/.#*
# rm -f */*/*/#*# */*/*/*~ */*/*/.#*