3eb7ed0397f3469cf2b2ea4b4368ec8cd7925a75
[freeradius.git] / src / modules / Makefile
1 #
2 # Makefile      Makefile for the cistron-radius package.
3 #
4 # Version:      $Id$
5 #
6
7 include ../../Make.inc
8
9 WHAT_TO_MAKE    = all
10
11 #
12 #  Build static AND dynamic libraries by default.
13 #  Later, we'll figure out how to get libtool to automagically do this.
14 #
15 TARGET_LIBS = static dynamic
16
17 all:
18         @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
19
20 static:
21         @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
22
23 dynamic:
24         @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
25
26 install:
27         install -d -m 755 $(libdir)
28         @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
29
30 clean:
31         @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
32         @rm -f *~ lib/[0-9a-z]* lib/STATIC_MODULE_LDFLAGS
33
34 distclean:
35         @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
36
37 common:
38         @[ -d lib/ ] || mkdir lib
39         @rm -f lib/STATIC_MODULE_LDFLAGS
40         @for mod in rlm_*; do \
41                 what=$(WHAT_TO_MAKE); \
42                 [ "$$what" = "all" ] && what="$(TARGET_LIBS)"; \
43                 echo "Making $$what in $$mod..."; \
44                 (cd $$mod && $(MAKE) $(MFLAGS) $$what) || exit 1;\
45         done