1 #######################################################################
3 # Each module should have a few common defines at the TOP of the
4 # Makefile, and the 'include ../rules.mak'
8 ##########################
10 # SRCS = rlm_foo.c other.c
12 # include ../rules.mak
14 # CFLAGS += my_c_flags
15 ##########################
17 # and everything will be automagically built
19 #######################################################################
21 include ../../../Make.inc
25 #######################################################################
27 # definitions for new dependencies on suffixes
29 #######################################################################
30 .SUFFIXES: .lo .o .so .a
32 #######################################################################
34 # define static and dynamic objects for the libraries,
35 # along with a number of other useful definitions.
37 #######################################################################
38 STATIC_OBJS = $(SRCS:.c=.o)
39 DYNAMIC_OBJS = $(SRCS:.c=.lo)
40 CFLAGS += -I../../include
42 #######################################################################
46 #######################################################################
48 $(CC) $(CFLAGS) $(RLM_CFLAGS) -c $< -o $@
51 $(CC) $(CFLAGS) $(RLM_CFLAGS) -fPIC -c $< -o $@
54 #######################################################################
56 # Define a number of new targets
58 #######################################################################
59 $(TARGET).a: $(STATIC_OBJS)
62 $(TARGET).so: $(DYNAMIC_OBJS)
63 $(LD) $(MODULE_LDFLAGS) $(LIBS) $^ -o $@
65 #######################################################################
67 # Generic targets so we can sweep through all modules
68 # without knowing what their names are.
70 # These rules also allow us to copy the '.a' or '.so' up
71 # a level, to the 'src/modules' directory, for general consumption.
73 #######################################################################
80 #######################################################################
82 # It's a dummy target: don't build it
84 #######################################################################
93 #######################################################################
95 # clean and install rules
97 #######################################################################
99 @rm -f *.a *.o *.lo *.so *~
102 @rm -f config.h config.mak