File: Makefile

package info (click to toggle)
hostname 3.18
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 72 kB
  • ctags: 35
  • sloc: ansic: 401; makefile: 76
file content (36 lines) | stat: -rw-r--r-- 1,130 bytes parent folder | download | duplicates (3)
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
CFLAGS+=-O2 -Wall -D_GNU_SOURCE

# uncomment the following line if you want to install to a different base dir.
#BASEDIR=/mnt/test

BINDIR:=/bin
MANDIR:=/usr/share/man

OBJS=hostname.o

hostname: $(OBJS)
	$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS)
	ln -fs hostname dnsdomainname
	ln -fs hostname domainname
	ln -fs hostname ypdomainname
	ln -fs hostname nisdomainname

install: hostname
	install -d ${BASEDIR}$(MANDIR)/man1
	install -o root -g root -m 0644 hostname.1 ${BASEDIR}$(MANDIR)/man1
	ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/dnsdomainname.1
	ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/domainname.1
	ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/ypdomainname.1
	ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/nisdomainname.1

	install -d ${BASEDIR}$(BINDIR)
	install -o root -g root -m 0755 hostname ${BASEDIR}$(BINDIR)
	ln -fs hostname ${BASEDIR}$(BINDIR)/dnsdomainname
	ln -fs hostname ${BASEDIR}$(BINDIR)/domainname
	ln -fs hostname ${BASEDIR}$(BINDIR)/nisdomainname
	ln -fs hostname ${BASEDIR}$(BINDIR)/ypdomainname

clean:
	-rm -f $(OBJS) hostname dnsdomainname domainname nisdomainname ypdomainname

.PHONY: clean install