File: rules

package info (click to toggle)
cccc 1%3A3.1.4-4
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 3,956 kB
  • sloc: ansic: 33,244; cpp: 10,527; java: 622; makefile: 156; sh: 11
file content (39 lines) | stat: -rwxr-xr-x 1,122 bytes parent folder | download | duplicates (2)
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
#! /usr/bin/make -f
%:
	dh $@

DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE  := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)

ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
	CROSS :=
else
	CROSS := CCC=$(DEB_HOST_GNU_TYPE)-g++ LD=$(DEB_HOST_GNU_TYPE)-g++
endif

# We have to duplicate a little from the upstream build system.  See
# cccc/posixgcc.mak.
CFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS += $(shell dpkg-buildflags --get CFLAGS)
CFLAGS += -c -I/usr/include/pccts -Wno-deprecated -Wall -x c++
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
buildflags := CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"

override_dh_auto_build:
	$(MAKE) -C cccc -f posixgcc.mak $(buildflags) \
		PCCTS_H=/usr/include/pccts PCCTS_BIN=/usr/bin $(CROSS)

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	$(MAKE) -C test -f posix.mak
endif

override_dh_auto_clean:
	$(MAKE) -C cccc -f posixgcc.mak clean
	-rmdir test/.cccc

override_dh_auto_install:
	# The default 'make install' uses su!

override_dh_installdocs:
	dh_installdocs 'cccc/CCCC User Guide.html'