File: Makefile

package info (click to toggle)
portsentry 1.2-11.2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 464 kB
  • ctags: 157
  • sloc: ansic: 2,283; makefile: 196; sh: 186; perl: 94; csh: 31
file content (217 lines) | stat: -rw-r--r-- 6,144 bytes parent folder | download | duplicates (4)
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# Makefile for PortSentry package.
# 
# Send problems/code hacks to help@psionic.com 
#
#
# STEALTH MODE: Only works on Linux systems right now.
#
# The snprintf included with the package is for use with NEXTSTEP only,
# (Thanks Timothy <tjl@luomat.org>) although it may work elsewhere.
# We've not tried it under any other OS to date. It shouldn't be needed
# by any modern OS.
#
# Others have used the snprintf from:
#
# http://www.ijs.si/software/snprintf/
#
# We've not tried this yet but others have had good success. Our only 
# piece of advice for those running an OS without built in snprintf()
# is to upgrade. :)
#
#
# Generic compiler (usually linked to gcc on most platforms)
CC = cc

# GNU..
#CC = gcc 

# Normal systems flags
CFLAGS = -g -O -Wall

# Debug mode for portsentry
#CFLAGS = -Wall -g -DNODAEMON -DDEBUG
#CFLAGS = -Wall -g -DNODAEMON
#CFLAGS = -Wall -g -DDEBUG

# Profiler mode for portsentry
#CFLAGS = -pg -O -Wall -DNODAEMON
#LIBS = /usr/lib/libefence.a

INSTALLDIR = /usr/local/psionic
CHILDDIR=/portsentry

all:
		@echo "Usage: make <systype>"
		@echo "<systype> is one of: linux, debian-linux, bsd, solaris, hpux, hpux-gcc,"
		@echo "freebsd, osx, openbsd, netbsd, bsdi, aix, osf, irix, generic"
		@echo "" 
		@echo "This code requires snprintf()/vsnprintf() system calls"
		@echo "to work. If you run a modern OS it should work on"
		@echo "your system with 'make generic'. If you get it to"
		@echo "work on an unlisted OS please write us with the" 
		@echo "changes." 
		@echo "" 
		@echo "Install: make install"
		@echo "" 
		@echo "NOTE: This will install the package in this" 
		@echo "      directory: $(INSTALLDIR)" 
		@echo "" 
		@echo "Edit the makefile if you wish to change these paths." 
		@echo "Any existing files will be overwritten."

clean:		
		/bin/rm -f ./portsentry 

uninstall:	
		/bin/rm $(INSTALLDIR)$(CHILDDIR)/*
		/bin/rmdir $(INSTALLDIR)

install:	
		@echo "Creating psionic directory $(INSTALLDIR)"
		@if [ ! -d $(INSTALLDIR) ]; then /bin/mkdir $(INSTALLDIR); fi
		@echo "Setting directory permissions"
		@if [ "$(INSTALLDIR)" = "/usr/local/psionic" ]; then /bin/chmod 700 $(INSTALLDIR) ; fi
		@echo "Creating portsentry directory $(INSTALLDIR)$(CHILDDIR)"
		@if [ ! -d $(INSTALLDIR)$(CHILDDIR) ]; then /bin/mkdir\
			$(INSTALLDIR)$(CHILDDIR); fi
		@echo "Setting directory permissions"
		chmod 700 $(INSTALLDIR)$(CHILDDIR)
		@echo "Copying files"
		cp ./portsentry.conf $(INSTALLDIR)$(CHILDDIR)
		cp ./portsentry.ignore $(INSTALLDIR)$(CHILDDIR)
		cp ./portsentry $(INSTALLDIR)$(CHILDDIR)
		@echo "Setting permissions"
		chmod 600 $(INSTALLDIR)$(CHILDDIR)/portsentry.ignore
		chmod 600 $(INSTALLDIR)$(CHILDDIR)/portsentry.conf
		chmod 700 $(INSTALLDIR)$(CHILDDIR)/portsentry
		@echo ""
		@echo ""
		@echo "Edit $(INSTALLDIR)$(CHILDDIR)/portsentry.conf and change"
		@echo "your settings if you haven't already. (route, etc)" 
		@echo ""
		@echo ""
		@echo "WARNING: This version and above now use a new"
		@echo "directory structure for storing the program"
		@echo "and config files ($(INSTALLDIR)$(CHILDDIR))."
		@echo "Please make sure you delete the old files when" 
		@echo "the testing of this install is complete."
		@echo ""
		@echo ""

linux:		
		SYSTYPE=linux 
		@echo "Making $(SYSTYPE)"
		$(CC) $(CFLAGS) -DLINUX -DSUPPORT_STEALTH -o ./portsentry ./portsentry.c \
		./portsentry_io.c ./portsentry_util.c $(LIBS)

debian-linux:		
		SYSTYPE=debian-linux 
		@echo "Making $(SYSTYPE)"
		$(CC) $(CFLAGS) -DLINUX -DDEBIAN -DSUPPORT_STEALTH -o ./portsentry ./portsentry.c \
		./portsentry_io.c ./portsentry_util.c $(LIBS)


bsd:		
		SYSTYPE=bsd
		@echo "Making $(SYSTYPE)"
		$(CC) $(CFLAGS) -DBSD44 -o ./portsentry ./portsentry.c \
		./portsentry_io.c ./portsentry_util.c


openbsd:		
		SYSTYPE=openbsd
		@echo "Making $(SYSTYPE)"
		$(CC) $(CFLAGS) -DBSD44 -o ./portsentry ./portsentry.c \
		./portsentry_io.c ./portsentry_util.c


freebsd:		
		SYSTYPE=freebsd
		@echo "Making $(SYSTYPE)"
		$(CC) $(CFLAGS) -DBSD44 -o ./portsentry ./portsentry.c \
		./portsentry_io.c ./portsentry_util.c

osx:		
		SYSTYPE=osx
		@echo "Making $(SYSTYPE)"
		$(CC) $(CFLAGS) -DBSD44 -o ./portsentry ./portsentry.c \
		./portsentry_io.c ./portsentry_util.c


netbsd:		
		SYSTYPE=netbsd
		@echo "Making $(SYSTYPE)"
		$(CC) $(CFLAGS) -DBSD44 -o ./portsentry ./portsentry.c \
		./portsentry_io.c ./portsentry_util.c


bsdi:		
		SYSTYPE=bsdi
		@echo "Making $(SYSTYPE)"
		$(CC) $(CFLAGS) -DBSD44 -o ./portsentry ./portsentry.c \
		./portsentry_io.c ./portsentry_util.c


generic:		
		SYSTYPE=generic
		@echo "Making $(SYSTYPE)"
		$(CC) $(CFLAGS) -o ./portsentry ./portsentry.c ./portsentry_io.c \
		./portsentry_util.c


hpux:		
		SYSTYPE=hpux
		@echo "Making $(SYSTYPE)"
		$(CC) -Ae -DHPUX -o ./portsentry ./portsentry.c ./portsentry_io.c \
		./portsentry_util.c


hpux-gcc:
		SYSTYPE=hpux-gcc
		@echo "Making $(SYSTYPE)"
		$(CC) $(CFLAGS) -DHPUX -o ./portsentry ./portsentry.c ./portsentry_io.c \
		./portsentry_util.c 


solaris:		
		SYSTYPE=solaris
		@echo "Making $(SYSTYPE)"
		$(CC) -lnsl -lsocket -lresolv -lc -o ./portsentry ./portsentry.c ./portsentry_io.c \
		./portsentry_util.c


aix:		
		SYSTYPE=aix
		@echo "Making $(SYSTYPE)"
		$(CC) $(CFLAGS) -o ./portsentry ./portsentry.c ./portsentry_io.c \
		./portsentry_util.c


osf:
		SYSTYPE=osf
		@echo "Making $(SYSTYPE)"
		$(CC) $(CFLAGS) -taso -ldb -o ./portsentry ./portsentry.c ./portsentry_io.c \
		./portsentry_util.c 


irix:
		SYSTYPE=irix
		@echo "Making $(SYSTYPE)"
		$(CC) $(CFLAGS) -O -n32 -mips3 -o ./portsentry ./portsentry.c ./portsentry_io.c \
		./portsentry_util.c 


# NeXTSTEP Users. NeXT used to work, but we changed the log function and
# it now uses vsnprintf() to format strings. This means that this
# version does not work under NeXTSTEP until we can find a workable
# vsnprintf() call to put in the program. Sorry. If you have some good
# vsnprintf() code to use under NeXT please send it to us and we'll 
# include it on the next update.
#next:		
#		SYSTYPE=next
#		@echo "Making $(SYSTYPE)"
#		$(CC) $(CFLAGS) -DNEXT -DHAS_NO_SNPRINTF -posix -o ./portsentry ./portsentry.c \
#		./portsentry_io.c ./portsentry_util.c