File: Makefile

package info (click to toggle)
bsdutils 4.4.1.1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 160 kB
  • ctags: 97
  • sloc: ansic: 1,347; makefile: 94; sh: 21
file content (76 lines) | stat: -rw-r--r-- 1,660 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
CC = gcc

LDFLAGS = -s
CFLAGS = -O2 -I. -DDEBIAN
LDLIBS = -lutil

INSTALL = install
LS = ls

bindir = /bin
usrbindir = /usr/bin
mandir = /usr/man
man1dir = $(mandir)/man1
man8dir = $(mandir)/man8

# Programs that are installed to $(bindir).
BINPROGS = kill

# Programs that are installed to $(usrbindir).
USRBINPROGS = logger renice script

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


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

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

all: $(BINPROGS) $(USRBINPROGS) $(SGIDTTYPROGS)

clean:
	rm -f $(BINPROGS) $(USRBINPROGS) $(SGIDTTYPROGS)
	rm -f *.o core *~ signames.h mksignames

install: all
	./mkinstalldirs $(bindir) $(usrbindir) $(man1dir) $(man8dir)
	for f in $(BINPROGS); \
	do \
	  $(INSTALL) -o root -g root -m 755 $$f $(bindir)/$$f; \
	done
	for f in $(USRBINPROGS); \
	do \
	  $(INSTALL) -o root -g root -m 755 $$f $(usrbindir)/$$f; \
	done
	for f in $(SGIDTTYPROGS); do \
	  $(INSTALL) -o root -g tty -m 2755 $$f $(usrbindir)/$$f; \
	done
	for f in *.1; \
	do \
	  $(INSTALL) -o root -g root -m 644 $$f $(man1dir)/$$f; \
	done
	for f in *.8; \
	do \
	  $(INSTALL) -o root -g root -m 644 $$f $(man8dir)/$$f; \
	done

#chroot:   chroot.o err.o getopt.o
kill:     err.o getopt.o kill.o
logger:   err.o getopt.o logger.o
renice:   err.o getopt.o renice.o
script:   getopt.o script.o
wall:     err.o getopt.o ttymsg.o wall.o

mksignames:	mksignames.c
	$(CC) $(CFLAGS) -DHAVE_STDLIB_H $< -o $@

kill.o:     signames.h
signames.h: mksignames
	$(RM) $@
	./mksignames | sed -e 's/"SIG/"/' \
			   -e 's/char \*signal_names/const char *sys_signame/'\
			   -e '/"DEBUG",/d' \
			   -e '/"EXIT",/d' > $@