File: Makefile

package info (click to toggle)
bsdmainutils 4.4.0.1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 592 kB
  • ctags: 479
  • sloc: ansic: 5,905; makefile: 126; sh: 116
file content (99 lines) | stat: -rw-r--r-- 2,603 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
CC = gcc
CFLAGS = -O2 -I. -I/usr/include/bsd   -DDEBIAN
LDFLAGS = -s
#LDLIBS = -lbsd
LDLIBS = 

INSTALL = install
LS = ls

# list of /usr/lib/calendar/YYYY directories to populate
YEARS = 1998 1999

usrbindir = /usr/bin
gamedir = /usr/games
libdir = /usr/lib
mandir = /usr/man
man1dir = $(mandir)/man1
man6dir = $(mandir)/man6


# Programs that are installed to $(usrbindir).
USRBINPROGS = cal calendar col colcrt colrm column from hexdump \
              look lorder tsort ul vacation whois

# Programs that are installed to $(gamedir).
GAMESPROGS = banner

# Programs installed to $(usrbindir), but setgid tty
SGIDTTYPROGS = write

.c.o:
	$(CC) $(CFLAGS) -c $<

.o:
	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)

all:  $(USRBINPROGS) $(GAMESPROGS) $(SGIDTTYPROGS)

clean:
	rm -f $(USRBINPROGS) $(GAMESPROGS) $(SGIDTTYPROGS)
	rm -f *.o core *~

install: all
	./mkinstalldirs $(usrbindir) $(gamedir) $(libdir) $(man1dir) $(man6dir)
	for f in $(USRBINPROGS); \
	do \
	  $(INSTALL) -o root -g root -m 755 $$f $(usrbindir)/$$f; \
	done
	for f in $(GAMESPROGS); \
	do \
	  $(INSTALL) -o root -g root -m 755 $$f $(gamedir)/$$f; \
	done
	for f in $(SGIDTTYPROGS); do \
	  $(INSTALL) -o root -g tty -m 2755 $$f $(usrbindir)/$$f; \
	done
	for year in $(YEARS); do \
	  $(INSTALL) -o root -g root -m 755 -d $(libdir)/calendar/$$year; \
	  for f in `$(LS) ./calendars/$$year`; \
	  do \
	    $(INSTALL) -o root -g root -m 644 \
		./calendars/$$year/$$f $(libdir)/calendar/$$year/$$f; \
	  done; \
	done
	for f in `$(LS) ./calendars/every.year`; \
	do \
	  $(INSTALL) -o root -g root -m 644 \
	      ./calendars/every.year/$$f $(libdir)/calendar/$$f; \
	done
	$(INSTALL) -o root -g root -m 644 ./calendars/default \
		 $(libdir)/calendar/default
	for f in *.1; \
	do \
	  $(INSTALL) -o root -g root -m 644 $$f $(man1dir)/$$f; \
	done
	for f in *.6; \
	do \
	  $(INSTALL) -o root -g root -m 644 $$f $(man6dir)/$$f; \
	done

banner:   banner.o err.o getopt.o
cal:      cal.o err.o getopt.o
calendar: calendar.o err.o getopt.o
col:      col.o err.o getopt.o
colcrt:   colcrt.o err.o getopt.o
colrm:    colrm.o getopt.o
column:   column.o err.o getopt.o
from:     err.o from.o getopt.o
hexdump:  conv.o display.o getopt.o hexdump.o hexsyntax.o odsyntax.o parse.o
look:     getopt.o look.o
lorder:   lorder.sh
script:   getopt.o script.o
tsort:    err.o getopt.o tsort.o
	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) -ldb
ul:       err.o getopt.o ul.o
	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) -lncurses
vacation: err.o getopt.o vacation.o
	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) -ldb
whois:    getopt.o whois.o
write:    err.o getopt.o write.o