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
|
#!/usr/bin/make -f
#
# Do we make rt.a into an ELF library?
# Do we make iconx link with xpm.so?
DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)
DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU 2>/dev/null)
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null)
# The current code use type-punning and signed overflow
ifneq (,$(filter $(DEB_HOST_ARCH), sparc mips mipsel))
CFLAGS_OPT = -O0
else
CFLAGS_OPT = -O2 -fno-strict-aliasing -fno-strict-overflow
endif
ifneq (, $(filter $(DEB_HOST_ARCH_OS), linux kfreebsd knetbsd))
system = linux
else
ifeq ($(DEB_HOST_ARCH_OS),hurd)
system = gnu
else
system = $(DEB_HOST_ARCH_OS)
endif
endif
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS_OPT = -O0
endif
CFLAGS = -Wall -g $(CFLAGS_OPT)
configure:
$(MAKE) X-Configure name=$(system)
sed "s/CFLAGS = .*/CFLAGS = $(CFLAGS)/" Makedefs > Makedefs.tmp
echo "ASFLAGS = -Wa,--noexecstack" >> Makedefs.tmp
mv Makedefs.tmp Makedefs
touch $@
build-icont: configure
$(MAKE) Icont
touch $@
build-ipl: configure
$(MAKE) Ilib
touch $@
clean:
rm -f configure build-icont build-ipl
rm -rf debian/iconx debian/icont debian/icon-ipl debian/files debian/*~
rm -f bin/* debian/substvars
$(MAKE) Pure
binary-icont: build-icont
rm -rf debian/icont
# Create the directory hierarchy.
install -d debian/icont/usr/bin
install -d debian/icont/DEBIAN
install -d debian/icont/usr/share/man/man1
install -d debian/icont/usr/share/doc/icont
# Copy the executables and documentation...
install -s -m 755 bin/icont debian/icont/usr/bin
ln -s icont debian/icont/usr/bin/icon
install -m 644 man/man1/icon.1 debian/icont/usr/share/man/man1/icon.1
install -m 644 man/man1/icont.1 debian/icont/usr/share/man/man1/icont.1
sed -e 's/icon-dir/icont/g' debian/copyright \
> debian/icont/usr/share/doc/icont/copyright
install -m 644 debian/changelog \
debian/icont/usr/share/doc/icont/changelog.Debian
# Patch icont...
# bin/patchstr debian/icont/usr/bin/icont /usr/bin/iconx
# Wrap icont to provide default for IPATH and LPATH
# mv debian/icont/usr/bin/icont debian/icont/usr/bin/icont.real
# install -o root -g root -m 755 debian/icont-wrapper debian/icont/usr/bin/icont
# Compress documentation...
gzip -9n debian/icont/usr/share/doc/icont/changelog.Debian
gzip -9rn debian/icont/usr/share/man
# cd debian/icont/usr/share/man/man1 && ln -sf icont.1.gz icont.real.1.gz
# Fix permissions...
chmod -R u=rwX,go=rX debian/icont
chown -R root:root debian/icont
# Make the debian control area.
dpkg-shlibdeps -pshlibs-icont debian/icont/usr/bin/*
dpkg-gencontrol -picont -Pdebian/icont
# And finally, build the Debian package!
dpkg --build debian/icont ..
binary-iconx: build-icont
rm -rf debian/iconx
# Create the directory hierarchy.
install -d debian/iconx/usr/bin
install -d debian/iconx/DEBIAN
install -d debian/iconx/usr/share/man/man1
install -d debian/iconx/usr/share/doc/iconx
# Copy the executables and documentation...
install -s -m 755 bin/iconx debian/iconx/usr/bin
install -m 644 man/man1/icon.1 debian/iconx/usr/share/man/man1/iconx.1
sed -e 's/icon-dir/iconx/g' debian/copyright \
> debian/iconx/usr/share/doc/iconx/copyright
install -m 644 debian/changelog \
debian/iconx/usr/share/doc/iconx/changelog.Debian
# Compress documentation...
gzip -9n debian/iconx/usr/share/doc/iconx/changelog.Debian
gzip -9rn debian/iconx/usr/share/man
# Fix permissions...
chmod -R u=rwX,go=rX debian/iconx
chown -R root:root debian/iconx
# Make the debian control area.
dpkg-shlibdeps -pshlibs-iconx debian/iconx/usr/bin/*
dpkg-gencontrol -piconx -Pdebian/iconx
# And finally, build the Debian package!
dpkg --build debian/iconx ..
binary-ipl: build-ipl
rm -rf debian/icon-ipl
# Create the directory hierarchy.
install -d debian/icon-ipl/DEBIAN
install -d debian/icon-ipl/usr/share/doc/icon-ipl
install -d debian/icon-ipl/usr/lib/icon-ipl
# Copy Icon program library...
cp -r lib/* ipl/procs/*.icn ipl/gprocs/*.icn debian/icon-ipl/usr/lib/icon-ipl
# Copy copyright information.
sed -e 's/icon-dir/icon-ipl/g' debian/copyright \
> debian/icon-ipl/usr/share/doc/icon-ipl/copyright
install -m 644 debian/changelog \
debian/icon-ipl/usr/share/doc/icon-ipl/changelog.Debian
# Compress documentation...
gzip -9n debian/icon-ipl/usr/share/doc/icon-ipl/changelog.Debian
find debian/icon-ipl/usr/share/doc/icon-ipl -type f -size +6k -print | \
xargs --no-run-if-empty gzip -9n
# Fix permissions...
chmod -R u=rwX,go=rX debian/icon-ipl
chown -R root:root debian/icon-ipl
# Make the debian control area.
dpkg-gencontrol -picon-ipl -Pdebian/icon-ipl
# And finally, build the Debian package!
dpkg --build debian/icon-ipl ..
test: build-icont build-ipl
@echo Tests for the Icon interpreter.
@echo First some simple tests to be sure Icon works.
$(MAKE) Samples-icont
@echo More exhaustive tests of various features of Icon and larger programs.
@echo 1. Basic tests. Should show only insignificant differences.
$(MAKE) Test-icont
benchmark: build-icont
$(MAKE) Benchmark-icont
build-arch: build
build-indep: build
build-iconx: build-icont
build: build-icont build-ipl test
binary-arch: binary-icont binary-iconx
binary-indep: binary-ipl
binary: binary-indep binary-arch
.PHONY: binary binary-arch binary-indep clean build build-arch build-indep test benchmark
|