12 @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
15 $(INSTALL) -d -m 755 $(R)$(libdir)
16 @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
19 @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
20 @rm -f *~ lib/rlm_* lib/*.o lib/smbencrypt lib/radeapclient
23 @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
25 # Requires GNU Make, but even older ones will do.
26 SUBDIRS := $(patsubst %/,%,$(dir $(wildcard $(addsuffix /Makefile,$(MODULES)))))
28 .PHONY: common libs $(SUBDIRS)
31 @[ -d lib/ ] || mkdir lib
32 @[ -d lib/.libs ] || mkdir lib/.libs
34 common: libs $(SUBDIRS)
37 @echo "Making $(WHAT_TO_MAKE) in $@..."
38 $(MAKE) $(MFLAGS) -C $@ $(WHAT_TO_MAKE)
40 # The rlm_*/*/* stuff is to catch the configure
41 CONFIG_FILES := $(wildcard rlm_*/configure.in rlm_*/*/*/configure.in)
43 .PHONY: reconfig $(CONFIG_FILES)
46 # Do NOT use "common", because some modules may not be built,
47 # and therefore their makefiles may be empty or non-existent.
51 @echo autoconf is needed for this target
53 ifeq "$(AUTOHEADER)" ""
55 @echo autoheader is needed for this target
57 reconfig: $(CONFIG_FILES)
61 # Don't use: $(MAKE) -C $(dir $@) reconfig
62 # The modules may not have a Makefile
64 @echo "Making reconfig in $(dir $@)..."
65 @cd $(dir $@) && $(AUTOCONF) -I $(top_builddir)
66 @if grep AC_CONFIG_HEADERS $@ >/dev/null; then\
67 cd $(dir $@) && $(AUTOHEADER); \