File: Makefile

package info (click to toggle)
whichman 2.4-10
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 324 kB
  • sloc: ansic: 1,033; makefile: 71
file content (63 lines) | stat: -rw-r--r-- 1,796 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
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
# written by Guido Socher
# overwrite with: make prefix=/some/where install
prefix=$(DESTDIR)/usr
INSTALL=install
mandir=$(prefix)/share/man
MANP=man1/whichman.1 man1/ftff.1 man1/ftwhich.1
CC=gcc
CFLAGS= -Wall -O2
#sun c/c++-compiler:
#CC=CC
#CFLAGS= -O
STRIP=strip


all:whichman ftff ftwhich

whichman: whichman.o levdist.o statduplcheck.o
	$(CC) $(LDFLAGS) -o $@ whichman.o levdist.o statduplcheck.o

ftwhich: ftwhich.o levdist.o statduplcheck.o
	$(CC) $(LDFLAGS) -o $@ ftwhich.o levdist.o statduplcheck.o

ftff: ftff.o levdist.o 
	$(CC) $(LDFLAGS) -o $@ ftff.o levdist.o

whichman.o: whichman.c 
	$(CC) $(CPPFLAGS) $(CFLAGS) -c whichman.c
ftwhich.o: ftwhich.c 
	$(CC) $(CPPFLAGS) $(CFLAGS) -c ftwhich.c
ftff.o: ftff.c 
	$(CC) $(CPPFLAGS) $(CFLAGS) -c ftff.c
levdist.o: levdist.c levdist.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -c levdist.c
statduplcheck.o: statduplcheck.c statduplcheck.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -c statduplcheck.c

install: whichman ftff ftwhich $(MANP)
	$(STRIP) whichman
	$(STRIP) ftwhich
	$(STRIP) ftff
	[ -d "$(prefix)/bin" ] || $(INSTALL) -d $(prefix)/bin
	[ -d "$(mandir)/man1" ] || $(INSTALL) -d $(mandir)/man1
	$(INSTALL) -m 755 whichman $(prefix)/bin
	$(INSTALL) -m 755 ftwhich $(prefix)/bin
	$(INSTALL) -m 755 ftff $(prefix)/bin
	for p in $(MANP) ; do \
		echo "installing $$p in $(mandir)/man1"; \
		$(INSTALL) -m 644 $$p $(mandir)/man1 ;\
	done

install_with_cp: whichman ftff ftwhich $(MANP)
	chmod 755 whichman ftff ftwhich
	[ -d "$(prefix)/bin" ] || mkdir -p $(prefix)/bin
	cp whichman ftff ftwhich $(prefix)/bin
	chmod 644 $(MANP)
	[ -d "$(mandir)/man1" ] || mkdir -p $(mandir)/man1
	cp $(MANP) $(mandir)/man1

debug: levdist.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o levdebug -DDEBUG -DRETURNVALUE levdist.c

clean:
	rm -f whichman ftff ftwhich *.o levdebug