File: Makefile

package info (click to toggle)
ipac 0.99-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 180 kB
  • ctags: 64
  • sloc: perl: 878; ansic: 451; sh: 169; makefile: 69
file content (47 lines) | stat: -rw-r--r-- 1,098 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
# $Id: Makefile,v 1.6 1998/07/16 13:55:45 moritz Exp $
SUBSTFILES=Makefile fetchipac ipacsum ipacset fetchipac.8 ipacset.8 \
	ipacsum.8
INSTFILES=fetchipac ipacsum ipacset
MANFILES=fetchipac.8 ipacset.8 ipacsum.8
CC=cc
CONFIG=config

# =()<INSTALLPATH=@<INSTALLPATH>@>()=
INSTALLPATH=/usr/local/bin
# =()<IMANPATH=@<IMANPATH>@>()=
IMANPATH=/usr/local/man/man8

all: dosubst

dosubst: subst config $(SUBSTFILES)
	@for file in $(SUBSTFILES); do \
		./subst -f $(CONFIG) $$file || exit 1; \
	done
	chmod +x $(INSTFILES)
	touch dosubst

# subst may have changed Makefile!
install: dosubst
	make doinstall

doinstall: install-bin install-man

install-bin:
	@for file in $(INSTFILES); do \
		echo "install -o root -g bin -m 755 $$file $(INSTALLPATH)/$$file"; \
		install -o root -g bin -m 755 $$file $(INSTALLPATH)/$$file || exit 1; \
	done

install-man:
	@for file in $(MANFILES); do \
		echo "install -o root -g bin -m 644 $$file $(IMANPATH)/$$file"; \
		install -o root -g bin -m 644 $$file $(IMANPATH)/$$file || exit 1; \
	done
	

subst: subst.c
	$(CC) -o subst subst.c

clean:
	rm -f subst dosubst