summaryrefslogtreecommitdiff
path: root/programs/pluto/alg/Makefile
blob: 9732cc80ec9e10c831a835218a1d3c011949988e (plain)
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
# pluto/alg Makefile
# Author: JuanJo Ciarlante <jjo-ipsec@mendoza.gov.ar>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
#
# $Id: Makefile,v 1.3 2004/06/23 04:45:20 as Exp $

Make.common: ../Makefile
	make -s -C .. showdefs > $@

-include Make.common
include Config.ike_alg

LIBCRYPTO:=../../../lib/libcrypto
ALLFLAGS=$(CPPFLAGS) $(CFLAGS) -I .. -I-  -I ../../../linux/include -I $(LIBCRYPTO)
LIBALG := libalg.o

all : $(LIBALG)

include $(wildcard Makefile.ike_alg_*)
#include $(wildcard Makefile.ike_alg_[ab]*)

ALG_DIRS:=$(ALG_DIRS-y)
ALG_LIBS:=$(ALG_LIBS-y)
ALG_SRCS:=$(ALG_SRCS-y)
ALG_OBJS:=$(ALG_OBJS-y)
$(LIBALG): ike_alginit.o $(ALG_OBJS) $(ALG_LIBS) 
	$(LD) -r -o $@ $^

# Search for IKE_ALG_INIT_NAME: in ike_alg_*.c to
# build ike_alginit.c:ike_alginit()

ike_alginit.c: $(ALG_SRCS) Makefile Config.ike_alg
	@awk '	\
		BEGIN { print "extern int ike_alg_init(void); \
			int ike_alg_init(void) {" } \
		/IKE_ALG_INIT_NAME:/ \
			{ print "{ extern int " $$2" (void); " $$2 "();}" } \
		END   { print "return 0;}" } \
		' $(ALG_SRCS) /dev/null > $@ 

clean :
	@for i in $(ALG_DIRS);do make -C $$i clean;done
	rm -f *.[oa] ike_alginit.c Make.common

gatherdeps:
	@ls $(ALG_SRCS) | grep '\.c' | sed -e 's/\(.*\)\.c$$/\1.o: \1.c/'
	@echo
	@ls $(ALG_SRCS) | grep '\.c' | xargs grep '^#[ 	]*include[ 	]*"' | \
		sed -n -e '/#include.*"lib/d' \
		-e 's/\.c:#[ 	]*include[ 	]*"/.o: ..\//' -e 's/".*//p'

# Dependencies generated by "make gatherdeps":

ike_alg_aes.o: ike_alg_aes.c
ike_alg_blowfish.o: ike_alg_blowfish.c
ike_alg_serpent.o: ike_alg_serpent.c
ike_alg_sha2.o: ike_alg_sha2.c
ike_alg_twofish.o: ike_alg_twofish.c

ike_alg_aes.o: ../constants.h
ike_alg_aes.o: ../defs.h
ike_alg_aes.o: ../log.h
ike_alg_aes.o: ../alg_info.h
ike_alg_aes.o: ../ike_alg.h
ike_alg_blowfish.o: ../constants.h
ike_alg_blowfish.o: ../defs.h
ike_alg_blowfish.o: ../log.h
ike_alg_blowfish.o: ../alg_info.h
ike_alg_blowfish.o: ../ike_alg.h
ike_alg_serpent.o: ../constants.h
ike_alg_serpent.o: ../defs.h
ike_alg_serpent.o: ../log.h
ike_alg_serpent.o: ../alg_info.h
ike_alg_serpent.o: ../ike_alg.h
ike_alg_sha2.o: ../constants.h
ike_alg_sha2.o: ../defs.h
ike_alg_sha2.o: ../log.h
ike_alg_sha2.o: ../alg_info.h
ike_alg_sha2.o: ../ike_alg.h
ike_alg_twofish.o: ../constants.h
ike_alg_twofish.o: ../defs.h
ike_alg_twofish.o: ../log.h
ike_alg_twofish.o: ../alg_info.h
ike_alg_twofish.o: ../ike_alg.h