Fixes from clang / scan-build
[freeradius.git] / src / modules / rlm_eap / libeap / Makefile
1 #
2 # Makefile
3 #
4 # Version:      $Id$
5 #
6
7 include ../../../../Make.inc
8
9 SRCS            = eapcommon.c eapcrypto.c eapsimlib.c fips186prf.c
10 ifneq ($(OPENSSL_LIBS),)
11 SRCS            += cb.c eap_tls.c mppe_keys.c tls.c
12 endif
13 LT_OBJS         = $(SRCS:.c=.lo)
14 INCLUDES        = eap_types.h eap_tls.h
15 CFLAGS          += -DEAPLIB -I. -I.. -I$(top_builddir)/src $(OPENSSL_INCLUDE)
16 ifeq ($(USE_SHARED_LIBS),yes)
17 LINK_MODE       = -export-dynamic
18 else
19 LINK_MODE       = -static
20 endif
21 TARGET          = $(LIBPREFIX)freeradius-eap
22
23 # Define new rule for libtool objects
24 %.lo: %.c
25         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $<
26
27 all: $(TARGET).la
28
29 $(TARGET).la: $(LT_OBJS)
30         $(LIBTOOL) --mode=link $(CC) -release $(RADIUSD_VERSION) \
31         $(LDFLAGS) $(LINK_MODE) -o $@ -rpath $(libdir) $^ \
32         $(LIBRADIUS) $(LIBS)
33         @for x in .libs/* $^; do \
34                 rm -f $(top_builddir)/src/modules/lib/$$x; \
35                 ln -s $(top_builddir)/src/modules/rlm_eap/libeap/$$x $(top_builddir)/src/modules/lib/$$x; \
36         done
37
38 $(LT_OBJS): $(INCLUDES)
39
40 clean:
41         rm -f *.o *.lo $(TARGET).la
42         rm -rf .libs
43
44 install: all
45         $(LIBTOOL) --mode=install $(INSTALL) -c $(TARGET).la \
46                 $(R)$(libdir)/$(TARGET).la
47         rm -f $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION).la;
48         ln -s $(TARGET).la $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION).la