File: rules

package info (click to toggle)
g2 0.23-4
  • links: PTS
  • area: main
  • in suites: slink
  • size: 520 kB
  • ctags: 533
  • sloc: ansic: 4,005; sh: 1,700; makefile: 134; fortran: 30
file content (106 lines) | stat: -rwxr-xr-x 2,423 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
#!/usr/bin/make -f
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.

package=g2

version=$(shell expr `pwd` : '.*-\([0-9.]*\)')
version_major=$(shell expr `pwd` : '.*-\([0-9]*\).[0-9.]*')

curdir=$(shell pwd)

headers = src/g2.h src/X11/g2_X11.h src/GIF/g2_GIF.h src/PS/g2_PS.h

CC := $(shell if [ -x /usr/bin/egcc ]; then echo egcc; else echo cc; fi)

docs = doc/g2-0.23.lsm doc/g2_ref.html doc/g2_ref.txt  TODO INSTALL README

#exampbin = g2_test  simple_PS simple_X11 simple_X11.c simple_PS.c simple_GIF.c demo_f.f Makefile


build:
	$(checkdir)
	-rm config.cache
	./configure 
	make CC=$(CC) depend
	make CC=$(CC) libg2.a
	-rm -f src/*.o src/*/*.o
	make CC=$(CC) PICFLAG="-fPIC" vers=$(version) shared
	touch build

clean:
	$(checkdir)
	-make clean

	-rm -f build

	-rm -f *.so

	-rm -f `find . -name "*~"`

	-rm -rf debian/tmp `find debian/* -type d ! -name CVS` debian/files* core
	-rm -f debian/files*
	-rm -f debian/*substvars

binary-indep: checkroot build
	$(checkdir)

binary-arch: checkroot build
	$(checkdir)
	-rm -rf debian/tmp
	install -d debian/tmp/usr/doc/$(package)/examples
	install -d debian/tmp/usr/lib
	install -d debian/tmp/usr/include
	cp $(headers)   debian/tmp/usr/include
	chmod 644 debian/tmp/usr/include/*
	cp $(docs)  debian/tmp/usr/doc/$(package)
	cp CHANGES debian/tmp/usr/doc/$(package)/changelog
	chmod 644 debian/tmp/usr/doc/$(package)/*
	cp demo/*  debian/tmp/usr/doc/$(package)/examples
	cp libg2.a debian/tmp/usr/lib
	strip --strip-debug debian/tmp/usr/lib/libg2.a
	strip --strip-debug libg2.so
	# Install shared library
#
	install -m 644 lib$(package).so  debian/tmp/usr/lib/lib$(package).so.$(version)

# Create .so link
#
	ln -s lib$(package).so.$(version) debian/tmp/usr/lib/lib$(package).so.$(version_major)


# Create .so link
#
	ln -s lib$(package).so.$(version_major) debian/tmp/usr/lib/lib$(package).so

# create both here. No dev package.



	debstd 
	dpkg-shlibdeps ./lib$(package).so 
	dpkg-gencontrol
	chown -R root.root debian/tmp
	chmod -R go=rX debian/tmp
#	chmod +x debian/tmp/usr/doc/$(package)/examples/*
#	chmod +x debian/tmp/usr/bin/factorint debian/tmp/usr/bin/induce
	dpkg --build debian/tmp ..


define checkdir
	test -f debian/rules
endef

binary: binary-indep binary-arch

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

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