File: rules

package info (click to toggle)
fpc 0.99.13-19991013-4
  • links: PTS
  • area: main
  • in suites: potato
  • size: 23,104 kB
  • ctags: 9,760
  • sloc: pascal: 253,711; ansic: 5,236; makefile: 3,855; yacc: 2,016; lex: 707; asm: 526; xml: 443; sh: 200; perl: 87; sed: 21; csh: 12; cpp: 1
file content (185 lines) | stat: -rwxr-xr-x 4,059 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
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
#!/usr/bin/make -f
# debian/rules for Free Pascal

# Don't load the system makefile.fpc
export FPCMAKE=
export FPCDIR=

# Documentation type to use pdf/html
DOCTYPE=pdf

# Get Package version and FPC version out of changelog file
PACKAGEVERSION=$(shell head -n 1 debian/changelog | awk '{ print $$2 }' | tr -d '[()]')
FPCVERSION=$(shell echo $(PACKAGEVERSION) | awk -F '-' '{ print $$1 }')

# Get directories	
PWD=$(shell pwd)
BUILD_DIR=$(PWD)/debian/build
INSTALL_DIR=$(PWD)/debian/tmp
NEWPP=$(PWD)/compiler/ppc386

export DH_COMPAT=2
# export DH_VERBOSE=1


###################
# Clean
#

clean:
	@echo "--- Cleaning"
	dh_testdir
	dh_testroot
	rm -f build-arch-stamp install-arch-stamp
	rm -f build-indep-stamp install-indep-stamp

	rm -f debian-files-stamp
	rm -f debian/*.files debian/*.docs debian/*.examples debian/*.postinst
	
	$(MAKE) compiler_clean
	$(MAKE) rtl_clean
	$(MAKE) utils_clean
	$(MAKE) fcl_clean
	$(MAKE) gtk_clean
	$(MAKE) api_clean
	$(MAKE) -C packages clean
	$(MAKE) -C docs clean

	dh_clean

# Cannot do that because the control-file is often needed afetr a cleanup
#	rm -f debian/control


###################
# Debian files
#

debian-files: debian-files-stamp
debian-files-stamp:
	@echo "--- Creating debian files"
	bash debian/fixdeb debian

	touch debian-files-stamp


###################
# Arch packages
#

build-arch: build-arch-stamp
build-arch-stamp: debian-files
	@echo "--- Building"
	dh_testdir

# First make a new Compiler and RTL using a make cycle
	$(MAKE) compiler_cycle
	$(MAKE) utils_all PP=$(NEWPP)

	$(MAKE) fcl_all PP=$(NEWPP)
	$(MAKE) gtk_all PP=$(NEWPP)
	$(MAKE) api_all PP=$(NEWPP)
	$(MAKE) -C packages all PP=$(NEWPP) RELEASE=1

	touch build-arch-stamp


install-arch: install-arch-stamp
install-arch-stamp: build-arch debian-files
	@echo "--- Installing"
	dh_testdir
	dh_testroot
	dh_clean -k

# Specify the compiler to use so installing will do correctly
	$(MAKE) compiler_install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr
	$(MAKE) rtl_install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr
	$(MAKE) utils_install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr

	$(MAKE) base_install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr
	$(MAKE) man_install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr/share
	$(MAKE) demo_install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr

	$(MAKE) fcl_install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr
	$(MAKE) gtk_install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr
	$(MAKE) api_install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr
	$(MAKE) -C packages install PP=$(NEWPP) PREFIXINSTALLDIR=$(INSTALL_DIR)/usr

	touch install-arch-stamp

###################
# Documentation
#

build-indep: build-indep-stamp
build-indep-stamp: debian-files
	@echo "--- Building Documentation"
	dh_testdir

	$(MAKE) -C docs $(DOCTYPE)

	touch build-indep-stamp

install-indep: install-indep-stamp
install-indep-stamp: debian-files build-indep
	@echo "--- Installing Documentation"
	dh_testdir
	dh_testroot
	dh_clean -k

	$(MAKE) -C docs $(DOCTYPE)install DOCINSTALLDIR=$(INSTALL_DIR)/usr/share/doc/fpc/$(FPCVERSION)/

	touch install-indep-stamp


###################
# Generic
#

build: build-arch build-indep

install: install-arch install-indep

binary: binary-indep binary-arch


###################
# Deb building
#

binary-indep: build-indep install-indep debian-files
	@echo "--- Building: arch-indep packages"
	dh_testversion 2
	dh_testdir
	dh_testroot
	dh_installdocs -i
	dh_installchangelogs -i
	dh_movefiles -i
	dh_compress -i -X.pdf
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: build-arch install-arch debian-files
	@echo "--- Building: arch packages"
	dh_testversion 2
	dh_testdir
	dh_testroot
	dh_installdocs -a
	dh_installchangelogs -a
	dh_undocumented -a
	dh_installexamples -a
	dh_movefiles -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
#	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a


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