File: rules

package info (click to toggle)
mercury 0.9-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 18,488 kB
  • ctags: 9,800
  • sloc: objc: 146,680; ansic: 51,418; sh: 6,436; lisp: 1,567; cpp: 1,040; perl: 854; makefile: 450; asm: 232; awk: 203; exp: 32; fortran: 3; csh: 1
file content (109 lines) | stat: -rwxr-xr-x 3,103 bytes parent folder | download
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
#!/usr/bin/make -f
# Sample debian.rules file - for GNU Hello (1.3).
# Copyright 1994,1995 by Ian Jackson.
# I hereby give you perpetual unlimited permission to copy,
# modify and relicense this file, provided that you do not remove
# my name from the file itself.  (I assert my moral right of
# paternity under the Copyright, Designs and Patents Act 1988.)
# This file may have to be extensively modified

package=mercury

MERCURY_MANS =	doc/c2init.1 doc/mmc.1 doc/mgnuc.1 doc/ml.1 \
		doc/mprof.1 
#DEBIAN_DOCS =	debian/README.debian debian/copyright 

	# A local installation of Mercury.  You might want to override
	# this to be where you installed a Mercury compiler to bootstrap 
	# with.  If you are building from an installed binary package in
	# /usr/bin it shouldn't be a problem
LOCAL_MERCURY_INSTALL = /home/tyson/install/bin

PATH	    := $(PATH):/usr/local/mercury-DEV/bin:$(LOCAL_MERCURY_INSTALL)

# To build, configure as if we are going to install in /usr,
# then build the compiler. 
build:
	$(checkdir)
	echo $(PATH)
	autoconf
	./configure --prefix=/usr
	make
	touch build

clean:
	$(checkdir)
	echo $(PATH)
	-rm -f build
	autoconf
	./configure 
	-mmake realclean
	-rm -f config.status config.cache config.log configure.log
	-rm -f runtime/mercury_conf.h boehm_gc/mercury_boehm_gc_conf.h
	-rm -f bindist/bindist.build_vars
	-rm -f make_all.log make_install.log mercury-compiler.spec
	-rm -f Mmake.common configure
	-rm -f `find . -name "*~"`
	-rm -rf debian/tmp debian/files* core debian/substvars

binary-indep: checkroot build
	$(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.
# XXX This isn't entirely true - all the .int files (and such)
# are architecture independent. But that's not really worth worrying
# about.


# To build the binary package, we install into ./debian/tmp/usr
# However, we have configured as if we are going to install into
# /usr, so we need to convince the "make install" target to
# install elsewhere.
# We override INSTALL_PREFIX to tell it to install to ./debian/tmp/usr.
# Hardcoded paths should be depending on FINAL_INSTALL_PREFIX instead,
# which we leave configured for /usr.
install: build 
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	make install INSTALL_PREFIX=`pwd`/debian/tmp/usr ;\

binary-arch: install
	# cp boehm_gc/README debian/tmp/usr/share/doc/mercury/README.boehm_gc
# We are probably going to have to override the installation directories
# to put the documents into /usr/share/doc
	dh_installdocs 
	dh_installexamples	samples/*
	dh_installmanpages

#	dh_undocumented		undocumented commands

	dh_strip
	dh_compress
	dh_fixperms
	dh_suidregister
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol

	dh_md5sums
	dh_builddeb

define checkdir
	test -f debian/rules
endef

# Below here is fairly generic really

binary: binary-indep binary-arch

source diff:
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

checkroot:
	$(checkdir)
	test root = "`whoami`"

.PHONY: binary binary-arch binary-indep clean checkroot