Files
mercury/debian/rules
Ian MacLarty 2e04ddc748 Remove the architecture string from the installed directory structure
Estimated hours taken: 1
Branches: main and 0.12

Remove the architecture string from the installed directory structure
and put the executables in $PREFIX/bin, instead of
$PREFIX/lib/mercury/bin/$FULLARCH.

The reason for this change is to reduce the need for unix shell scripts in
the top-level bin directory that call the actual programs in the
lib/mercury/bin/FULLARCH directory.  The unix scripts can't be run on Windows
without a unix emulation environment like Cygwin.

Because the executables are now in the top-level bin directory, we cannot
install multiple architectures under the same directory structure.  However
this is not a real loss, since the binaries for different architectures can
just be installed to different locations, as we currently do anyway on
mundula.cs.mu.oz.au.

The plan is to rename mercury_compile to mmc and do away with the mmc unix
script.  This will allow mmc to be run on Windows without Cygwin or MSYS.
This proposal replaces a previous proposal to implement a C version of the
mmc script.  That solution turned out to be quite complicated and
unreliable.

This diff will also mean mdice, mslice and mtc_union will be in the same
directory as mmc, so will be in the PATH as long as mmc is in the PATH.

configure.in:
bindist/Mmakefile:
bindist/bindist.Makefile.in:
compiler/compile_target_code.m:
compiler/handle_options.m:
compiler/make.program_target.m:
debian/rules:
library/Mmakefile:
scripts/Mmake.vars.in:
scripts/mdprof.in:
scripts/mercury.bat.in:
scripts/mgnuc.in:
scripts/ml.in:
scripts/mmc.in:
scripts/mprof.in:
tools/run_all_tests_from_cron:
tools/test_mercury:
	Remove FULLARCH from the installed directory structure.
	Install executables to the top-level bin directory.
2005-10-25 10:17:29 +00:00

178 lines
4.4 KiB
Makefile
Executable File

#!/usr/bin/make -f
# -*- makefile -*-
# debian/rules for the Mercury compiler
# GNU copyright 1997 to 1999 by Joey Hess.
# Changes: Peter Hawkins (public domain)
#
#
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DH_COMPAT=3
# This has to be exported to make some magic below work.
export DH_OPTIONS
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
# We really need this to be 'gcc', not 'cc'
CC=gcc
MACHINE=`$(CC) -dumpmachine`
GRADES_COMMON=hlc.gc
ifneq ($(findstring $(DEB_HOST_ARCH),i386 amd64 powerpc alpha m68k mips sparc),)
ifneq ($(findstring $(DEB_HOST_ARCH),powerpc),)
# For some reason asm_fast.gc.prof.tr doesn't build correctly
# on powerpc
GRADES=$(GRADES_COMMON),asm_fast.gc,asm_fast.gc.prof,asm_fast.gc.memprof,asm_fast.gc.tr,asm_fast.gc.tr.debug,hlc.gc.prof.tr
else
GRADES=$(GRADES_COMMON),asm_fast.gc,asm_fast.gc.prof,asm_fast.gc.memprof,asm_fast.gc.tr,asm_fast.gc.tr.debug,asm_fast.gc.prof.tr,asm_fast.gc.profdeep,asm_fast.gc.profdeep.tr,hlc.gc.tr,hlc.gc.prof.tr
endif
else
ifneq ($(findstring $(DEB_HOST_ARCH),ia64 hppa),)
GRADES+=$(GRADES_COMMON),reg.gc,reg.gc.prof,reg.gc.memprof,reg.gc.tr,reg.gc.tr.debug,reg.gc.prof.tr
else
# arm, mipsel, s390
GRADES+=$(GRADES_COMMON),none.gc,hlc.gc.prof,hlc.gc.memprof,hlc.gc.tr,none.gc.tr.debug,hlc.gc.prof.tr
endif
endif
configure: configure-stamp
configure-stamp:
dh_testdir
(cd build ; \
tar zxvf ../upstream/mercury-compiler-*.tar.gz ; \
mv mercury-compiler-* mercury ; \
)
cp /usr/share/misc/config.sub /usr/share/misc/config.guess build/mercury/
# Apply Debian specific patches
if test ! -f patch-stamp; then \
for patch in $(CURDIR)/debian/patches/*.diff ; do\
echo APPLYING PATCH\: $${patch##*/};\
(cd build ; patch -p0 < $$patch) ;\
done ;\
touch patch-stamp ;\
fi
echo "Building grades: $(GRADES)"
# Create the cgi-bin directory or the configure script barfs.
mkdir -p debian/tmp/usr/lib/cgi-bin
cd build/mercury && \
CC="$(CC)" BOOTSTRAP_MC="/nonexistent" ./configure --host=$(MACHINE) --prefix=/usr --enable-deep-profiler=$(CURDIR)/debian/tmp/usr/lib/cgi-bin --enable-libgrades=$(GRADES)
touch configure-stamp
#Architecture
build: build-stamp
build-stamp: configure-stamp
(cd build/mercury ; $(MAKE) $(PMAKEFLAGS) )
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp install-stamp patch-stamp
rm -rf build/*
dh_clean
install: install-stamp
install-stamp:
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs -A
cd build/mercury && \
CC="$(CC)" \
MERCURY_COMPILER="$(CURDIR)/debian/tmp/usr/bin/mercury_compile" \
$(MAKE) install INSTALL_PREFIX=$(CURDIR)/debian/tmp/usr $(MAKEFLAGS)
cp build/mercury/README build/mercury/README.DotNet \
build/mercury/README.Java build/mercury/README.Linux* \
build/mercury/README.gcc-backend build/mercury/RELEASE_NOTES \
build/mercury/BUGS build/mercury/HISTORY \
build/mercury/LIMITATIONS \
build/mercury/NEWS build/mercury/TODO \
build/mercury/WORK_IN_PROGRESS debian/mercury/usr/share/doc/mercury/
touch install-stamp
# Build architecture independant packages using the common target.
binary-indep: build install
dh_testdir
dh_testroot
dh_installchangelogs -i
dh_installdocs -i
dh_installexamples -i
dh_install -i
# dh_installmenu
# dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_installinit
# dh_installcron
dh_installinfo -i
dh_installman -i
dh_link -i
dh_compress -i
dh_fixperms -i
# dh_perl
# dh_python
dh_makeshlibs -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
# Build architecture dependent packages using the common target.
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs -a
dh_installdocs -a
dh_installexamples -a
dh_install -a
# dh_installmenu
# dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_installinit
# dh_installcron
dh_installinfo -a
dh_installman -a
dh_link -a
dh_strip -a
dh_compress -a
dh_fixperms -a
# dh_perl
# dh_python
dh_makeshlibs -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-arch binary-indep
.PHONY: build clean binary binary install configure