File: Makefile

package info (click to toggle)
netcat 1.10-41
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 1,740 kB
  • ctags: 2,171
  • sloc: ansic: 1,830; sh: 796; makefile: 128
file content (122 lines) | stat: -rw-r--r-- 3,781 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
119
120
121
122
# makefile for netcat, based off same ol' "generic makefile".
# Usually do "make systype" -- if your systype isn't defined, try "generic"
# or something else that most closely matches, see where it goes wrong, fix
# it, and MAIL THE DIFFS back to Hobbit.

### PREDEFINES

# DEFAULTS, possibly overridden by <systype> recursive call:
# pick gcc if you'd rather , and/or do -g instead of -O if debugging
# debugging
# DFLAGS = -DTEST -DDEBUG
CFLAGS = -O
XFLAGS = 	# xtra cflags, set by systype targets
XLIBS =		# xtra libs if necessary?
# -Bstatic for sunos,  -static for gcc, etc.  You want this, trust me.
STATIC =
CC = gcc $(CFLAGS)
LD = $(CC) $(LDFLAGS)	# linker; defaults to unstripped executables
o = o		# object extension

ALL = nc

### BOGON-CATCHERS

bogus:
	@echo "Usage:  make  <systype>  [options]"

### HARD TARGETS

nc:	netcat.c
	$(LD) $(DFLAGS) $(XFLAGS) $(STATIC) -o nc netcat.c $(XLIBS)

nc-dos:
	@echo "DOS?!  Maybe someday, but not now"

### SYSTYPES -- in the same order as in generic.h, please

# designed for msc and nmake, but easy to change for your compiler.
# Recursive make may fail if you're short on memory -- u-fix!
# Note special hard-target and "quotes" instead of 'quotes' ...
dos:
	$(MAKE) -e $(ALL)-dos $(MFLAGS) CC="cl /nologo" XLIBS= \
	XFLAGS="/AS -D__MSDOS__ -DMSDOS"  o=obj

ultrix:
	make -e $(ALL) $(MFLAGS) XFLAGS='-DULTRIX'

# you may need XLIBS='-lresolv -l44bsd' if you have BIND 4.9.x
sunos:
	make -e $(ALL) $(MFLAGS) XFLAGS='-DSUNOS' STATIC=-Bstatic \
	XLIBS='-lresolv'

# Pick this one ahead of "solaris" if you actually have the nonshared
# libraries [lib*.a] on your machine.  By default, the Sun twits don't ship
# or install them, forcing you to use shared libs for any network apps.
# Kludged for gcc, which many regard as the only thing available.
solaris-static:
	make -e $(ALL) $(MFLAGS) XFLAGS='-DSYSV=4 -D__svr4__ -DSOLARIS' \
	CC=gcc STATIC= XLIBS='-lnsl -lsocket -lresolv'

# the more usual shared-lib version...
solaris:
	make -e $(ALL) $(MFLAGS) XFLAGS='-DSYSV=4 -D__svr4__ -DSOLARIS' \
	CC=gcc STATIC= XLIBS='-lnsl -lsocket -lresolv'

aix:
	make -e $(ALL) $(MFLAGS) XFLAGS='-DAIX'

linux:
	make -e $(ALL) $(MFLAGS) XFLAGS='-DLINUX' STATIC=

# irix 5.2, dunno 'bout earlier versions.  If STATIC='-non_shared' doesn't
# work for you, null it out and yell at SGI for their STUPID default
# of apparently not installing /usr/lib/nonshared/*.  Sheesh.
irix:
	make -e $(ALL) $(MFLAGS) XFLAGS='-DIRIX -DSYSV=4 -D__svr4__' \
	STATIC=-non_shared

osf:
	make -e $(ALL) $(MFLAGS) XFLAGS='-DOSF' STATIC=-non_shared

# virtually the same as netbsd/bsd44lite/whatever
freebsd:
	make -e $(ALL) $(MFLAGS) XFLAGS='-DFREEBSD' STATIC=

bsdi:
	make -e $(ALL) $(MFLAGS) XFLAGS='-DBSDI' STATIC=-Bstatic

netbsd:
	make -e $(ALL) $(MFLAGS) XFLAGS='-DNETBSD' STATIC=

# finally got to an hpux box, which turns out to be *really* warped. 
# STATIC here means "linker subprocess gets args '-a archive'" which causes
# /lib/libc.a to be searched ahead of '-a shared', or /lib/libc.sl.
hpux:
	make -e $(ALL) $(MFLAGS) XFLAGS='-DHPUX' STATIC="-Wl,-a,archive"

# unixware from bmc@telebase.com; apparently no static because of the
# same idiotic lack of link libraries
unixware:
	make -e $(ALL) $(MFLAGS) XFLAGS='-DUNIXWARE -DSYSV=4 -D__svr4__' \
	STATIC= XLIBS='-L/usr/lib -lnsl -lsocket -lresolv'

# from Declan Rieb at sandia, for a/ux 3.1.1 [also suggests using gcc]:
aux:
	make -e $(ALL) $(MFLAGS) XFLAGS='-DAUX' STATIC= CC=gcc

# Nexstep from mudge: NeXT cc is really old gcc
next:
	make -e $(ALL) $(MFLAGS) XFLAGS='-DNEXT' STATIC=-Bstatic

# start with this for a new architecture, and see what breaks.
generic:
	make -e $(ALL) $(MFLAGS) XFLAGS='-DGENERIC' STATIC=

# Still at large: dgux dynix ???

### RANDOM

clean:
	rm -f $(ALL) *.o *.obj