1ALL=eap_example
2
3include ../src/build.rules
4
5CFLAGS += -I.
6CFLAGS += -I../src
7CFLAGS += -I../src/utils
8
9
10EAP_LIBS += ../src/utils/libutils.a
11EAP_LIBS += ../src/crypto/libcrypto.a
12EAP_LIBS += ../src/tls/libtls.a
13
14OBJS_both += ../src/eap_common/eap_peap_common.o
15OBJS_both += ../src/eap_common/eap_psk_common.o
16OBJS_both += ../src/eap_common/eap_pax_common.o
17OBJS_both += ../src/eap_common/eap_sake_common.o
18OBJS_both += ../src/eap_common/eap_gpsk_common.o
19OBJS_both += ../src/eap_common/chap.o
20
21OBJS_peer += ../src/eap_peer/eap_tls.o
22OBJS_peer += ../src/eap_peer/eap_peap.o
23OBJS_peer += ../src/eap_peer/eap_ttls.o
24OBJS_peer += ../src/eap_peer/eap_md5.o
25OBJS_peer += ../src/eap_peer/eap_mschapv2.o
26OBJS_peer += ../src/eap_peer/mschapv2.o
27OBJS_peer += ../src/eap_peer/eap_otp.o
28OBJS_peer += ../src/eap_peer/eap_gtc.o
29OBJS_peer += ../src/eap_peer/eap_leap.o
30OBJS_peer += ../src/eap_peer/eap_psk.o
31OBJS_peer += ../src/eap_peer/eap_pax.o
32OBJS_peer += ../src/eap_peer/eap_sake.o
33OBJS_peer += ../src/eap_peer/eap_gpsk.o
34OBJS_peer += ../src/eap_peer/eap.o
35OBJS_peer += ../src/eap_common/eap_common.o
36OBJS_peer += ../src/eap_peer/eap_methods.o
37OBJS_peer += ../src/eap_peer/eap_tls_common.o
38
39CFLAGS += -DEAP_TLS
40CFLAGS += -DEAP_PEAP
41CFLAGS += -DEAP_TTLS
42CFLAGS += -DEAP_MD5
43CFLAGS += -DEAP_MSCHAPv2
44CFLAGS += -DEAP_GTC
45CFLAGS += -DEAP_OTP
46CFLAGS += -DEAP_LEAP
47CFLAGS += -DEAP_PSK
48CFLAGS += -DEAP_PAX
49CFLAGS += -DEAP_SAKE
50CFLAGS += -DEAP_GPSK -DEAP_GPSK_SHA256
51
52CFLAGS += -DEAP_SERVER_IDENTITY
53CFLAGS += -DEAP_SERVER_TLS
54CFLAGS += -DEAP_SERVER_PEAP
55CFLAGS += -DEAP_SERVER_TTLS
56CFLAGS += -DEAP_SERVER_MD5
57CFLAGS += -DEAP_SERVER_MSCHAPV2
58CFLAGS += -DEAP_SERVER_GTC
59CFLAGS += -DEAP_SERVER_PSK
60CFLAGS += -DEAP_SERVER_PAX
61CFLAGS += -DEAP_SERVER_SAKE
62CFLAGS += -DEAP_SERVER_GPSK -DEAP_SERVER_GPSK_SHA256
63
64CFLAGS += -DIEEE8021X_EAPOL
65
66
67# Optional components to add EAP server support
68OBJS_server += ../src/eap_server/eap_server_tls.o
69OBJS_server += ../src/eap_server/eap_server_peap.o
70OBJS_server += ../src/eap_server/eap_server_ttls.o
71OBJS_server += ../src/eap_server/eap_server_md5.o
72OBJS_server += ../src/eap_server/eap_server_mschapv2.o
73OBJS_server += ../src/eap_server/eap_server_gtc.o
74OBJS_server += ../src/eap_server/eap_server_psk.o
75OBJS_server += ../src/eap_server/eap_server_pax.o
76OBJS_server += ../src/eap_server/eap_server_sake.o
77OBJS_server += ../src/eap_server/eap_server_gpsk.o
78OBJS_server += ../src/eap_server/eap_server.o
79OBJS_server += ../src/eap_server/eap_server_identity.o
80OBJS_server += ../src/eap_server/eap_server_methods.o
81OBJS_server += ../src/eap_server/eap_server_tls_common.o
82CFLAGS += -DEAP_SERVER
83
84
85OBJS_lib=$(OBJS_both) $(OBJS_peer) $(OBJS_server)
86_OBJS_VAR := OBJS_lib
87include ../src/objs.mk
88
89OBJS_ex = eap_example.o eap_example_peer.o eap_example_server.o
90_OBJS_VAR := OBJS_ex
91include ../src/objs.mk
92
93_OBJS_VAR := EAP_LIBS
94include ../src/objs.mk
95
96
97ifneq ($(CONFIG_SOLIB), yes)
98LIBEAP = libeap.a
99libeap.a: $(EAP_LIBS) $(OBJS_lib)
100	$(AR) crT libeap.a $^
101	$(RANLIB) libeap.a
102
103else
104CFLAGS  += -fPIC -DPIC
105LDFLAGS += -shared
106
107LIBEAP  = libeap.so
108libeap.so: $(EAP_LIBS) $(OBJS_lib)
109	$(LDO) $(LDFLAGS) $^ -o $(LIBEAP)
110
111endif
112
113eap_example: $(OBJS_ex) $(LIBEAP)
114	$(LDO) $(LDFLAGS) -o eap_example $(OBJS_ex) -L. -leap $(LIBS)
115
116clean: common-clean
117	rm -f core *~ *.o *.d libeap.a libeap.so
118
119-include $(OBJS:%.o=%.d)
120