File: Makefile

package info (click to toggle)
mcvert 2.16-6
  • links: PTS
  • area: non-free
  • in suites: potato
  • size: 164 kB
  • ctags: 218
  • sloc: ansic: 1,699; makefile: 80
file content (118 lines) | stat: -rw-r--r-- 3,038 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
## This file is formatted with a tab-width of 3

## See the README file for hints how to configure this Makefile.

CSOURCES    = mcvert.c hqxify.c unpack.c
HSOURCES    = mactypes.h
SOURCES     = $(CSOURCES) $(HSOURCES) \
              Makefile README README-conversion mcvert.idraw mcvert.1
MANIFEST    = $(SOURCES) mcvert.man
OBJECTS     = mcvert.o hqxify.o unpack.o $(XOBJ)
ALL         = mcvert mcvert.man
EVERYTHING  = $(ALL) shar mcvert.ps
CLEAN       = $(OBJECTS) $(EVERYTHING)

VERSION=216

BIN = .

##
## *LAST* Defintion Always Wins ##
##

## Note: when using -lnet, AT&T 3B2 fails with undefined symbols like
##       t_errno first used in /usr/lib/libnet.a
##    so extract gettod.o and explicitly bind it in

### Extra Objects
# for AT&T 3B2
#XOBJ= gettod.o
# common case
XOBJ=

### Bind Time Library Selection
# for SCO UNIX 3.2v4.1 with SCO TCPIP 1.2.0
#LIBS= -lsocket
# for most implementations
LIBS=

## Note that ftime() is obsolete, and has been replaced by gettimeofday()
## so, in general, you should be using -DTIMEVAL
## but I am not  able  to test this  on all platforms  on all releases,
## so we leave the aging recipe in place

### Machine CFLAGS
## for machines with <timeb.h> and ftime() [and maybe without gettimeofday()]
# eg: works for ULTRIX
CFLAGS_M=
## for machines with ulong pre-defined
#CFLAGS_M= -DULONG
# eg: A/UX, SGI's Irix, AT&T 3B2, IBM RS/6000's AIX
CFLAGS_M= -DTIMEVAL -DULONG
## for machines with gettimeofday() [and maybe without <timeb.h> and ftime()]
# eg: HP-UX 9.01, SunOS 4.1.3, DomainOS 10.4
#CFLAGS_M= -DTIMEVAL

### Byteorder(3n) [eg: htonl()] and Byte Manipulation [eg: bzero, bcopy] CFLAGS
# uncommon case -- without support, eg: AT&T 3B2
#CFLAGS_N = -DNOBYTEORDER -DNOBZEROBCOPY
# unknown case 1
#CFLAGS_N = -DNOBYTEORDER
# unknown case 2
#CFLAGS_N = -DNOBZEROBCOPY
# common case -- with support for  both
CFLAGS_N =

### Debugging/Optimization CFLAGS
# debugging
CFLAGS_D = -g
# optimization
CFLAGS_D = -O2

### All CFLAGS
CFLAGS=$(CFLAGS_M) $(CFLAGS_N) $(CFLAGS_D) -DVERSION=$(VERSION)

### lint related
LINT=lint
LFLAGS=$(CFLAGS_M) $(CFLAGS_N) -DVERSION=$(VERSION)

all: $(ALL)
everything: $(EVERYTHING)

mcvert: $(OBJECTS)
	$(CC) $(CFLAGS) $(OBJECTS) $(LIBS) -o $(BIN)/mcvert

lint: $(HSOURCES) $(CSOURCES)
	$(LINT) $(LFLAGS) $(CSOURCES) | fgrep -vf lint-ignore

$(SOURCES):
	sccs get $@

gettod.o:
	ar -xv /usr/lib/libnet.a $@

$(OBJECTS): mactypes.h Makefile

shar : mcvert-$(VERSION).shar
mcvert-$(VERSION).shar : $(MANIFEST)
	shar $(MANIFEST) > $@
	@nawk 'length($0) > 80 {exit(1)}' $@ || { make check_linelen; false; }

# we punt the issue of expanding tabs
check_linelen: $(MANIFEST)
	@nawk 'length($0) >= 80 { printf "%s: %d: ", FILENAME, FNR; print }' \
		$(MANIFEST)

clean:
	rm -f $(CLEAN)

man: mcvert.man
mcvert.man: mcvert.1
	nroff -man mcvert.1 | col | sed 's/.//g' | expand > $@
mcvert.ps: mcvert.1
	groff -man mcvert.1 > $@

F=mcvert-$(VERSION).shar
info:
	@for todo in "ls -l" "head -3" "tail -3" sum wc; do \
		echo $$todo $F; $$todo $F | sed 's/^/	/'; done