OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / freeswan / klips / utils / Makefile
1 # Makefile for the KLIPS interface utilities
2 # Copyright (C) 1998, 1999  Henry Spencer.
3 # Copyright (C) 1999, 2000, 2001  Richard Guy Briggs
4
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by the
7 # Free Software Foundation; either version 2 of the License, or (at your
8 # option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
9
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13 # for more details.
14 #
15 # RCSID $Id: Makefile,v 1.28 2002/01/30 00:17:05 mcr Exp $
16
17
18 include ../../Makefile.inc
19
20
21
22 CC=gcc
23 CFLAGS=$(USERCOMPILE) -I../net/ipsec -I../../lib
24
25 CFLAGS+= $(USERCOMPILE)
26 CFLAGS+= -Wall
27 #CFLAGS+= -Wconversion
28 #CFLAGS+= -Wmissing-prototypes
29 CFLAGS+= -Wpointer-arith
30 CFLAGS+= -Wcast-qual
31 #CFLAGS+= -Wmissing-declarations
32 CFLAGS+= -Wstrict-prototypes
33 #CFLAGS+= -pedantic
34 #CFLAGS+= -W
35 #CFLAGS+= -Wwrite-strings
36 CFLAGS+= -Wbad-function-cast 
37
38 ALL=spi eroute spigrp tncfg klipsdebug pf_key
39 MANDIR8=$(MANTREE)/man8
40 MANDIR5=$(MANTREE)/man5
41 FREESWANLIB=../../lib/libfreeswan.a
42
43 all: $(ALL)
44
45 programs: all
46
47 check: $(ALL)
48
49 install: $(ALL)
50         mkdir -p $(BINDIR) $(MANDIR8) $(MANDIR5)
51         $(INSTALL) $(ALL) $(BINDIR)
52         for f in $(addsuffix .8, $(ALL)) ; do \
53                 $(INSTALL) $$f $(MANDIR8)/ipsec_$$f || exit 1 ; done
54         for f in $(addsuffix .5, $(ALL) version pf_key) ; do \
55                 $(INSTALL) $$f $(MANDIR5)/ipsec_$$f || exit 1 ; done
56
57 constants.o : ../../pluto/constants.c ../../pluto/constants.h
58         $(CC) $(CFLAGS) -c -o $@ $<
59
60 alg_info.o : ../../pluto/alg_info.c ../../pluto/alg_info.h
61         $(CC) $(CFLAGS) -DNO_PLUTO -c -o $@ $<
62
63 kernel_alg.o : ../../pluto/kernel_alg.c ../../pluto/kernel_alg.h
64         $(CC) $(CFLAGS) -DNO_PLUTO -c -o $@ $<
65
66 spi: spi.o constants.o alg_info.o kernel_alg.o
67         $(CC) $(DFLAGS) -o $@ $^ $(FREESWANLIB)
68
69 eroute: eroute.o
70         $(CC) $(DFLAGS) -o $@ $? $(FREESWANLIB)
71
72 spigrp: spigrp.o
73         $(CC) $(DFLAGS) -o $@ $? $(FREESWANLIB)
74
75 tncfg: tncfg.o
76         $(CC) $(DFLAGS) -o $@ $? $(FREESWANLIB)
77
78 pf_key: pf_key.o
79         $(CC) $(DFLAGS) -o $@ $? $(FREESWANLIB)
80
81 klipsdebug: klipsdebug.o
82         $(CC) $(DFLAGS) -o $@ $? $(FREESWANLIB)
83
84 cleanall: clean
85
86 distclean: clean
87
88 mostlyclean: clean
89
90 realclean: clean
91
92 clean:
93         rm -f *.o $(ALL)
94
95 checkprograms:
96
97 #
98 # $Log: Makefile,v $
99 # Revision 1.28  2002/01/30 00:17:05  mcr
100 #       replace -O2 with $(USERCOMPILE) in CFLAGS to match other Makefiles.
101 #
102 # Revision 1.27  2002/01/17 04:38:45  rgb
103 # Take compile options from top level Makefile.inc
104 # Change the "programs" target to depend on the "all" target.
105 #
106 # Revision 1.26  2001/12/05 07:21:19  rgb
107 # Make sure KLIPS utils get compiled first time through.
108 #
109 # Revision 1.25  2001/11/27 16:27:07  mcr
110 #       added new "checkprograms" target to deal with programs that
111 #       are required for "make check", but that may not be ready to
112 #       build for every user due to external dependancies.
113 #
114 # Revision 1.24  2001/11/27 05:08:17  rgb
115 # Remove temporary version.o dependancy.
116 #
117 # Revision 1.23  2001/11/26 09:24:28  rgb
118 # Added version.o to klipsdebug.
119 #
120 # Revision 1.22  2001/11/23 07:23:14  mcr
121 #       pulled up klips2 Makefile and pf_key code.
122 #
123 # Revision 1.21  2001/10/30 17:42:01  mcr
124 #       make all destination dirs used for installation.
125 #
126 # Revision 1.20  2001/10/24 14:41:42  henry
127 # Makefile.inc
128 #
129 # Revision 1.17.4.3  2001/10/18 00:13:30  mcr
130 #       fix Makefile to reflect name of program is "pf_key" not "pfkey"
131 #
132 # Revision 1.17.4.2  2001/10/17 23:25:37  mcr
133 #       added "pk_key" program to dump raw kernel pf messages.
134 #       (program is still skeletal)
135 #
136 # Revision 1.17.4.1  2001/10/01 03:53:08  mcr
137 #       changes for UML build (main branch)
138 #
139 # Revision 1.17.2.1  2001/09/25 01:31:55  mcr
140 #       added usage of $(DESTDIR)
141 #       added setting of FREESWANLIB.
142 #
143 # Revision 1.17  2001/06/14 19:35:13  rgb
144 # Update copyright date.
145 #
146 # Revision 1.16  2000/06/30 06:20:25  rgb
147 # Add version.5 and pf_key.5 to the list of manpages to be installed.
148 #
149 # Revision 1.15  2000/06/28 05:51:23  rgb
150 # Install section 5 manpages.
151 #
152 # Revision 1.14  2000/01/21 09:44:29  rgb
153 # Added compiler switches to be a lot more fussy.
154 #
155 # Revision 1.13  1999/04/11 00:12:07  henry
156 # GPL boilerplate
157 #
158 # Revision 1.12  1999/04/06 04:54:37  rgb
159 # Fix/Add RCSID Id: and Log: bits to make PHMDs happy.  This includes
160 # patch shell fixes.
161 #
162 # Revision 1.11  1999/04/03 05:39:06  henry
163 # install -d doesn't do what I thought
164 #
165 # Revision 1.10  1999/04/03 05:23:23  henry
166 # use INSTALL
167 #
168 # Revision 1.9  1998/11/12 21:11:21  rgb
169 # Change default binary install directory from /usr/local/sbin to
170 # /usr/local/lib/ipsec.
171 #
172 # Revision 1.8  1998/11/07 05:38:54  henry
173 # changes for manpage ipsec_ prefix
174 #
175 # Revision 1.7  1998/07/28 00:08:07  rgb
176 # Add freeswan lib.
177 #
178 # Revision 1.6  1998/06/11 05:40:52  rgb
179 # Install manpages when binaries are installed.
180 #
181 # Revision 1.5  1998/05/12 02:28:07  rgb
182 # Utils can now be compiled before kernel install/config.
183 #
184 # Revision 1.4  1998/05/06 03:35:40  rgb
185 # Changed make install from an 'mv' to a 'cp'.
186 #
187 # Revision 1.3  1998/04/23 21:09:16  rgb
188 # Added a userspace util to change kernelspace debug switches.
189 #
190 # Revision 1.2  1998/04/14 14:07:01  rgb
191 # Permanently remove setsa.c and addrt.c from the distribution and fix the
192 # Makefile.
193 #
194 # Revision 1.1.1.1  1998/04/08 05:35:09  henry
195 # RGB's ipsec-0.8pre2.tar.gz ipsec-0.8
196 #
197 # Revision 0.5  1997/06/03 04:31:55  ji
198 # Added esp 3des-md5-96.
199 # Added transport mode configuration utility.
200 #
201 # Revision 0.4  1997/01/15 01:38:21  ji
202 # Changed to include setsa.c
203 #
204 # Revision 0.3  1996/11/20 14:51:32  ji
205 # Fixed problems with #include paths.
206 # Changed (incorrect) references to ipsp into ipsec.
207 #
208 #