File: Makefile

package info (click to toggle)
rsh-redone 85-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 224 kB
  • sloc: ansic: 2,118; makefile: 74; sh: 11
file content (56 lines) | stat: -rw-r--r-- 1,382 bytes parent folder | download | duplicates (2)
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
BIN = rlogin rsh
SBIN = in.rlogind in.rshd
MAN1 = rlogin.1 rsh.1
MAN5 = rhosts.5
MAN8 = rlogind.8 rshd.8
PAM = pam/rlogin pam/rsh

CC ?= gcc
PREFIX ?= /usr
INSTALL ?= install
BINDIR ?= $(PREFIX)/bin
SBINDIR ?= $(PREFIX)/sbin
SHAREDIR ?= $(PREFIX)/share
SYSCONFDIR ?= $(PREFIX)/etc
MANDIR ?= $(SHAREDIR)/man
PAMDIR ?= $(SYSCONFDIR)/pam.d
CFLAGS ?= -Wall -g -O2 -pipe -DBINDIR=\"$(BINDIR)\"

all: $(BIN) $(SBIN)

rlogin: rlogin.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $<

in.rlogind: rlogind.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< -lutil -lpam

rsh: rsh.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $<

in.rshd: rshd.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpam

install: install-bin install-sbin install-man install-pam

install-bin: $(BIN)
	mkdir -p $(DESTDIR)$(BINDIR)
	$(INSTALL) -m 4755 $(BIN) $(DESTDIR)$(BINDIR)/

install-sbin: $(SBIN)
	mkdir -p $(DESTDIR)$(SBINDIR)
	$(INSTALL) $(SBIN) $(DESTDIR)$(SBINDIR)/

install-man: $(MAN1) $(MAN5) $(MAN8)
	mkdir -p $(DESTDIR)$(MANDIR)/man1/
	mkdir -p $(DESTDIR)$(MANDIR)/man5/
	mkdir -p $(DESTDIR)$(MANDIR)/man8/
	$(INSTALL) -m 644 $(MAN1) $(DESTDIR)$(MANDIR)/man1/
	$(INSTALL) -m 644 $(MAN5) $(DESTDIR)$(MANDIR)/man5/
	$(INSTALL) -m 644 $(MAN8) $(DESTDIR)$(MANDIR)/man8/

install-pam: $(PAM)
	mkdir -p $(DESTDIR)$(PAMDIR)
	$(INSTALL) -m 644 $(PAM) $(DESTDIR)$(PAMDIR)/

clean:
	rm -f $(BIN) $(SBIN)