File: Makefile

package info (click to toggle)
uutraf 1.1-10
  • links: PTS
  • area: main
  • in suites: woody
  • size: 104 kB
  • ctags: 110
  • sloc: ansic: 805; makefile: 88; sh: 17
file content (72 lines) | stat: -rw-r--r-- 1,904 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Makefile for uutraf  - an UUCP traffic analyzer
#                                                             -*- Makefile -*-

# If you want to obtain news articles statistics by default, uncomment the
# following line.
DEFS	= -DDEFAULT_NEWSSTATS

# If you do *not* want to have each transfer rounded up to the next kB when
# applying kB fees (ie if you want to apply this fee to the real transfer
# volume), uncomment the following line.
DEFS	+= -DDEFAULT_PROVFEEPERKBMULT=0
DEFS	+= -DCFGFILE=\"$(LIBDIR)/uutraf.cf\" -DVERSION=\"$(VERSION)\"

CFLAGS  = -g -O2 -Wall
LIBS    = -lm
LDFLAGS =

BIN     = uutraf
MAN1    = $(BIN).1
MAN5    = $(BIN).5
SRCS	= config.c stats.c utils.c
OBJS	= $(SRCS:.c=.o)
HEADER  = $(BIN).h
CFFILE  = uutraf.cf

VERSION = 1.1
prefix  =
LIBDIR  = $(prefix)/etc/uucp
BINDIR  = $(prefix)/usr/bin
MAN1DIR = $(prefix)/usr/share/man/man1
MAN5DIR = $(prefix)/usr/share/man/man5

all:	$(BIN)

source:	$(SRCS) $(HEADER) $(MAN1) $(MAN5) $(CFFILE)
# implicit rules.

$(BIN).c:
	co -kv $@

$(MAN1):
$(MAN5):
	co -kk $(MAN1) $(MAN5)
	mv $(MAN1) $(MAN1).sed
	mv $(MAN5) $(MAN5).sed
	sed "s/\\\$$Date\\\$$/`date +'%B %_d, %Y'`/g" $(MAN1).sed > $(MAN1)
	sed "s/\\\$$Date\\\$$/`date +'%B %_d, %Y'`/g" $(MAN5).sed > $(MAN5)
	-$(RM) $(MAN1).sed $(MAN5).sed
	chmod 644 $(MAN1) $(MAN5)

.c.o:	$(HEADER) $(SRCS) $(OBJS)
	$(CC) $(CFLAGS) $(DEFS) -c -o $@ $<

$(BIN):	$(BIN).c $(HEADER) $(SRCS) $(OBJS) $(MAN)
	$(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -o $(BIN) $(BIN).c $(OBJS) $(LIBS)

clean:
	$(RM) *.o *~ *.bak \#*\# errors core* a.out TAGS

distclean:	clean
	$(RM) $(BIN)

realclean:	distclean
	-rcsclean
	-$(RM) *.[ch15]

install:	$(MAN1) $(MAN5) $(BIN) $(CFFILE)
	install -d -m 755 $(BINDIR) $(MAN1DIR) $(MAN5DIR) $(LIBDIR)
	install -s -m 755 $(BIN)     $(BINDIR)
	install    -m 644 $(MAN1)    $(MAN1DIR)
	install    -m 644 $(MAN5)    $(MAN5DIR)
	install    -m 644 $(CFFILE)  $(LIBDIR)/$(CFFILE)