File: rules

package info (click to toggle)
picasm 1.5-2.1
  • links: PTS
  • area: non-free
  • in suites: hamm, slink
  • size: 168 kB
  • ctags: 342
  • sloc: ansic: 3,440; asm: 150; makefile: 33
file content (47 lines) | stat: -rwxr-xr-x 1,131 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
#! /usr/bin/make -f

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

package = picasm
d=$(shell pwd)/debian/tmp

build: checkdir
	$(MAKE) CFLAGS='-Wall -O2 -g' -f makefile.uni

clean: checkdir
	$(MAKE) -f makefile.uni clean
	$(RM) -r debian/{files,substvars,tmp}
	find . -name \*~ -print0 | xargs -0 $(RM)

binary:	checkdir build checkroot
	$(RM) -r $(d)

	install -d $(d)/DEBIAN 
	install -d $(d)/usr/doc/$(package)
	install -d $(d)/usr/man/man1

	install -c debian/changelog $(d)/usr/doc/$(package)/changelog.Debian
	install -c picasm.doc $(d)/usr/doc/$(package)
	gzip -9vf $(d)/usr/doc/$(package)/*
	install -c debian/copyright $(d)/usr/doc/$(package)/copyright

	install -d $(d)/usr/bin
	install -cs picasm $(d)/usr/bin/

	install -c picasm.1 $(d)/usr/man/man1
	gzip -9vf $(d)/usr/man/man1/*
	
	chown -R root.root $(d)
	find $(d) -type f -print0 | xargs -0 chmod 644
	find $(d) -type d -print0 | xargs -0 chmod 755
	chmod a+x $(d)/usr/bin/*

	dpkg-shlibdeps $(d)/usr/bin/*
	dpkg-gencontrol -p$(package) -P$(d)
	dpkg --build $(d) ..

checkdir:
	test -f makefile.wat

checkroot:
	test "`whoami`" = "root"