OSDN Git Service

Add MS7619SE
[uclinux-h8/uClinux-dist.git] / openswan / lib / Makefile.library
1 KLIPSD=${OPENSWANSRCDIR}/linux/include
2 KLIPSSRCDIR=${OPENSWANSRCDIR}/linux/net/ipsec
3 MANSRCDIR=${OPENSWANSRCDIR}/lib/libopenswan
4
5 LEX=flex
6 ifeq ($(USE_YACC),true)
7 BISON=yacc -b parser
8 else
9 BISON=bison
10 endif
11
12 VPATH+= ${KLIPSSRCDIR}
13 OSDEP?=$(shell uname -s | tr 'A-Z' 'a-z')
14
15 # Original flags
16 INCLUDES+=-I. -I${KLIPSSRCDIR} -I${KLIPSD} -I${OPENSWANSRCDIR}
17 INCLUDES+=-I${OPENSWANSRCDIR}/include 
18 CFLAGS+=${PORTINCLUDE} ${INCLUDES} ${CROSSFLAGS}
19 CFLAGS+=-DDEBUG
20 CFLAGS+= $(USERCOMPILE)
21 ifneq ($(BUILDENV),darwin)
22 CFLAGS+= -Wall
23 endif
24 #CFLAGS+= -Wconversion
25 #CFLAGS+= -Wmissing-prototypes
26 CFLAGS+= -Wpointer-arith
27 CFLAGS+= -Wcast-qual
28 #CFLAGS+= -Wmissing-declarations
29 CFLAGS+= -Wstrict-prototypes
30 #CFLAGS+= -pedantic
31 #CFLAGS+= -W
32 #CFLAGS+= -Wwrite-strings
33 CFLAGS+= -Wbad-function-cast 
34
35 ifeq ($(USE_NAT_TRAVERSAL),true)
36 CFLAGS+= -DNAT_TRAVERSAL
37 endif
38
39 ifeq ($(USE_KLIPS),true)
40 CFLAGS+= -DKLIPS
41 endif
42
43 ARFLAGS=crvs
44 MANS=
45
46 .PHONY: all install clean l t lt tar check depend checkprograms
47
48 # we can't do tests with two conditions, but we can concatenate the strings
49 SHOULDWERESTART=${USE_OBJDIR}$(wildcard ${ONEFILE})
50 ifeq ($(SHOULDWERESTART),true${ONEFILE})
51 all programs clean install:
52         cd ${OPENSWANSRCDIR} && cd ${OBJDIRTOP}/lib/lib${LIBRARY} && ${MAKE} $@
53 else
54 all:    $(LIB) 
55 programs: $(LIB) 
56 clean:  cleanall
57 install: doinstall
58
59 endif
60
61 doinstall:
62         @for d in $(MANDIR); do mkdir -p $$d; done
63         @for f in $(MANS) ; \
64         do \
65                 $(INSTALL) $(INSTMANFLAGS) $(MANSRCDIR)/$$f $(MANDIR)/ipsec_$$f || exit 1 ; \
66         done
67         @$(OPENSWANSRCDIR)/packaging/utils/manlink $(foreach man, $(MANS), ${MANSRCDIR}/$(man)) | \
68         while read from to; \
69         do \
70                 ln -s -f ipsec_$$from $(MANDIR)/$$to; \
71         done
72
73
74 install_file_list:
75         @for f in $(MANS) ; \
76         do \
77                 echo $(MANDIR)/ipsec_$$f;\
78         done;
79         @$(OPENSWANSRCDIR)/packaging/utils/manlink $(foreach man, $(MANS), ${MANSRCDIR}/$(man)) | \
80         while read from to; \
81         do \
82                 echo $(MANDIR)/$$to; \
83         done
84
85 $(LIB): $(OBJS)
86         $(AR) $(ARFLAGS) $(LIB) $(OBJS)
87
88 $(OBJS):        $(HDRS)
89
90 cleanall::
91         rm -rf ${OBJS} $(LIB)
92
93 # Gather dependencies caused by explicit #includes within .c files
94 depend: ${DISTSRC}
95         @(ls $(DISTSRC) | grep '\.c' | xargs $(GCC) -MM ${PORTINCLUDE} ${INCLUDES} ${ALLFLAGS} ) | sed -e 's,${OPENSWANSRCDIR},../..,g' >Makefile.depend.${OSDEP}
96
97 -include ${srcdir}Makefile.depend.${OSDEP}
98
99
100