summaryrefslogtreecommitdiffstats
path: root/debian/rules
blob: 5f84d69c99368f976b764c5196f8d1d5ba9c69bd (plain)
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
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

YACC      := YACC=/usr/bin/byacc
BOOTSTRAP := ASH=/bin/bash ECHO=/bin/echo MKDIR=/bin/mkdir CP=/bin/cp \
  RM=/bin/rm INSTALL=/usr/bin/install $(YACC)
SVNROOT   := https://svn.netlabs.org/repos/kbuild/trunk
REVISION  := $(shell echo $(DEB_VERSION_UPSTREAM) | sed -e's,.*svn,,' | sed -e's,+dfsg.*,,')

%:
	dh $@

override_dh_auto_configure:
	echo "KBUILD_SVN_URL := $(SVNROOT)"  >  SvnInfo.kmk
	echo "KBUILD_SVN_REV := $(REVISION)" >> SvnInfo.kmk

override_dh_auto_build:
	$(info DEBUG: macros defined by gcc:)
	-gcc -dM -E - < /dev/null
	kBuild/env.sh --full make -f bootstrap.gmk SRCDIR=`pwd` $(BOOTSTRAP)
	kBuild/env.sh kmk rebuild PATH_INS=`pwd` KBUILD_VERBOSE=2 $(YACC)

override_dh_auto_install:
	kBuild/env.sh kmk install NIX_INSTALL_DIR=/usr KBUILD_VERBOSE=2

override_dh_auto_clean:
	-kBuild/env.sh kmk uninstall
	rm -rf debian/stamp-* out kBuild/bin/*/* SvnInfo.kmk
	( cd src/kmk; rm -f aclocal.m4 config.h.in configure Makefile.in config/ar-lib )
	( cd src/kmk/config; rm -f compile config.guess config.sub depcomp install-sh Makefile.in missing )
	rm -f src/kmk/glob/Makefile.in src/kmk/w32/Makefile.in
	( cd src/sed/config; rm -f intdiv0.m4 intmax.m4 inttypes_h.m4 inttypes.m4 inttypes-pri.m4 isc-posix.m4 longdouble.m4 longlong.m4 mkinstalldirs nls.m4 po.m4 printf-posix.m4 signed.m4 size_max.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4 wchar_t.m4 wint_t.m4 xsize.m4 )
	( cd src/sed/intl; rm -f libgnuintl.h.in localcharset.h log.c printf-args.c printf-args.h printf.c printf-parse.c printf-parse.h relocatable.c relocatable.h vasnprintf.c vasnprintf.h vasnwprintf.h wprintf-parse.h xsize.h )
	( cd src/sed/po; rm -f Makevars.template remove-potcdate.sin )

get-orig-info:
	svn info $(SVNROOT) | grep "Last Changed Rev:" | cut -d' ' -f4

get-orig-source:
	sh debian/orig-tar.sh $(SVNROOT) $(DEB_VERSION_UPSTREAM)