added libeap subdir, and radeapclient test function.
[freeradius.git] / src / modules / rlm_eap / Makefile.in
1 TARGET      = @targetname@
2 SRCS        = rlm_eap.c eap.c mem.c state.c
3 HEADERS     = eap.h rlm_eap.h
4 RLM_CFLAGS  = $(INCLTDL) -I@srcdir@/libeap
5 CLIENTLIBS  = -Llibeap -leap -L../../lib -lradius
6 #RLM_LIBS    = $(shell for x in types/rlm_eap*/rlm_eap*.la;do echo -dlpreopen $$x;done)
7 RLM_INSTALL = install-types
8 RLM_SUBDIRS = libeap @eaptypes@ 
9
10
11 $(STATIC_OBJS): $(HEADERS)
12
13 #
14 #  Statically link a few modules.
15
16 STATIC_OBJS     += $(shell ls -1 types/rlm_eap_md5/rlm_eap_md5.a types/rlm_eap_leap/rlm_eap_leap.a types/rlm_eap_tls/rlm_eap_tls.a types/rlm_eap_ttls/rlm_eap_ttls.a types/rlm_eap_sim/rlm_eap_sim.a 2>/dev/null)
17
18 $(DYNAMIC_OBJS): $(HEADERS)
19
20 all: 
21         @$(MAKE) $(MFLAGS) static dynamic
22         @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
23         @$(MAKE) $(MFLAGS) radeapclient
24
25 radeapclient: radeapclient.o ../../lib/libradius.a
26         $(LIBTOOL) --mode=link $(CC) $(CFLAGS) ${RLM_CFLAGS} $(LDFLAGS) -o radeapclient radeapclient.o $(CLIENTLIBS) $(LIBS)
27
28 radeapclient.o: radeapclient.c $(INCLUDES)
29         $(CC) $(CFLAGS) ${RLM_CFLAGS} -c radeapclient.c
30
31 allclean:
32         @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=clean common
33
34 install-types:
35         @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=install common
36
37 common:
38         @for dir in $(RLM_SUBDIRS); do  \
39                 echo "Making $(WHAT_TO_MAKE) in $$dir..."; \
40                 (cd $$dir && $(MAKE) $(MFLAGS) $(WHAT_TO_MAKE)) || exit 1;\
41         done
42
43 ## this uses the RLM_CFLAGS and RLM_LIBS and SRCS defs to make TARGET.
44 include ../rules.mak
45