File: rules

package info (click to toggle)
altgcc 2.7.2.2-3.4
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 29,424 kB
  • ctags: 31,164
  • sloc: ansic: 330,932; sh: 8,626; yacc: 7,861; asm: 5,153; makefile: 1,821; objc: 476; cpp: 307; sed: 261; pascal: 95
file content (102 lines) | stat: -rwxr-xr-x 3,701 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
#!/usr/bin/make -f
# Build rules for altGCC (2.7.2.2)
# Based heavily on Ian Jackson's sample rules file for GNU hello
# 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.)

package=altgcc

CFLAGS = -O2 -DHAVE_MKSTEMP -DMKTEMP_EACH_FILE
LDFLAGS = -s

ARCH = $(shell dpkg --print-gnu-build-architecture)
VER = 2.7.2.2

build:
	$(checkdir)
	./configure --prefix=/usr --target=$(ARCH)-linuxlibc1 
	# A bit of cross-compiling trickery.
	$(MAKE) CFLAGS="$CFLAGS" OLDCC=gcc OLDAR=ar \
	  gxx_include_dir=/usr/$(ARCH)-linuxlibc1/include/g++ libgcc1.a
	$(MAKE) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" AR=ar \
	  LANGUAGES="c c++" gxx_include_dir=/usr/$(ARCH)-linuxlibc1/include/g++
	# A bit of sed magic to remove bogus -lieee spec
	sed s/-lieee// < specs > specs.new
	rm specs
	mv specs.new specs
	touch build

clean:
	$(checkdir)
	-rm -f build
# The Makefile.in trick dosen't work anymore, since the makefile structure
# has gone recursive.  If Makefile dosen't exist, it's probably clean anyway.
	-$(MAKE) -i distclean
	-rm -rf libgcc1.cross libgcc1-test *~ debian/tmp debian/*~ debian/files* debian/substvar*

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.

binary-arch:    checkroot build
	$(checkdir)
	-rm -rf debian/tmp
	install -d debian/tmp/DEBIAN debian/tmp/usr/doc/$(package)
	# Install gcc
	$(MAKE) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
		prefix=`pwd`/debian/tmp/usr LANGUAGES="c c++" install
	# Make symbolic links 
	rm -rf debian/tmp/usr/info debian/tmp/usr/man
	rm -rf debian/tmp/usr/$(ARCH)-linuxlibc1/include
	rm -rf debian/tmp/usr/bin/$(ARCH)-linuxlibc1-c++
	install -d debian/tmp/usr/$(ARCH)-linuxlibc1/bin
	ln -sf ../../bin/$(ARCH)-linuxlibc1-gcc debian/tmp/usr/$(ARCH)-linuxlibc1/bin/gcc
	ln -sf ../../bin/$(ARCH)-linuxlibc1-gcc debian/tmp/usr/$(ARCH)-linuxlibc1/bin/cc
	ln -sf ../../lib/gcc-lib/$(ARCH)-linuxlibc1/$(VER)/cpp debian/tmp/usr/$(ARCH)-linuxlibc1/bin/cpp
	ln -sf ../../bin/$(ARCH)-linuxlibc1-g++ debian/tmp/usr/$(ARCH)-linuxlibc1/bin/g++
	ln -sf ../../bin/$(ARCH)-linuxlibc1-g++ debian/tmp/usr/$(ARCH)-linuxlibc1/bin/c++
	ln -sf ../../bin/$(ARCH)-linuxlibc1-gcc debian/tmp/usr/$(ARCH)-linuxlibc1/bin/$(ARCH)-linuxlibc1-gcc
	cp /usr/lib/gcc-lib/$(ARCH)-linux/2.7.2.3/include/float.h debian/tmp/usr/lib/gcc-lib/$(ARCH)-linuxlibc1/$(VER)/include
	mkdir -p debian/tmp/usr/man/man1
	ln -s ../man7/undocumented.7.gz \
              debian/tmp/usr/man/man1/$(ARCH)-linuxlibc1-g++.1.gz
	ln -s ../man7/undocumented.7.gz \
              debian/tmp/usr/man/man1/$(ARCH)-linuxlibc1-gcc.1.gz

	chmod -x debian/tmp/usr/lib/gcc-lib/$(ARCH)-linuxlibc1/$(VER)/specs
	chmod -R u+w debian/tmp
	# Final boilerplate
	cp debian/copyright debian/tmp/usr/doc/$(package)/.
	cp debian/changelog debian/tmp/usr/doc/$(package)/changelog.Debian
	cp ChangeLog debian/tmp/usr/doc/$(package)/changelog
	gzip -9v debian/tmp/usr/doc/$(package)/changelog{,.Debian}
	dpkg-shlibdeps debian/tmp/usr/bin/*
	dpkg-gencontrol 
	chown -R root.root debian/tmp
	chmod -R g-ws debian/tmp
	dpkg --build debian/tmp ..

define checkdir
	test -f cccp.c -a -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