10 MFLAGS += --no-print-directory
13 @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
16 $(INSTALL) -d -m 755 $(R)$(libdir)
17 @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
20 @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
21 @rm -f *~ lib/rlm_* lib/*.o lib/smbencrypt lib/radeapclient
24 @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
26 # Requires GNU Make, but even older ones will do.
27 SUBDIRS := $(patsubst %/,%,$(dir $(wildcard $(addsuffix /Makefile,$(MODULES)))))
29 .PHONY: common libs $(SUBDIRS)
32 @[ -d lib/ ] || mkdir lib
33 @[ -d lib/.libs ] || mkdir lib/.libs
35 common: libs $(SUBDIRS)
38 @echo "Making $(WHAT_TO_MAKE) in $(X)modules/$@..."
39 @$(MAKE) $(MFLAGS) X=$(X)modules/ -C $@ $(WHAT_TO_MAKE)
41 # The rlm_*/*/* stuff is to catch the configure
42 CONFIG_FILES := $(wildcard rlm_*/configure.in rlm_*/*/*/configure.in)
44 .PHONY: reconfig $(CONFIG_FILES)
47 # Do NOT use "common", because some modules may not be built,
48 # and therefore their makefiles may be empty or non-existent.
52 @echo autoconf is needed for this target
54 ifeq "$(AUTOHEADER)" ""
56 @echo autoheader is needed for this target
58 reconfig: $(CONFIG_FILES)
62 # Don't use: $(MAKE) -C $(dir $@) reconfig
63 # The modules may not have a Makefile
65 @echo "Making reconfig in $(dir $@)..."
66 @cd $(dir $@) && $(AUTOCONF) -I ./m4 -I $(top_builddir) -I $(top_builddir)/m4
67 @if grep AC_CONFIG_HEADERS $@ >/dev/null; then\
68 cd $(dir $@) && $(AUTOHEADER); \