1 #######################################################################
3 # This rule should be first.
5 # If the file 'config.mak' doesn't exist,
6 # GNU Make will look for a makefile rule to build it,
7 # and then execute that rule.
9 #######################################################################
12 #######################################################################
14 # This section sets the general names of things. Each Makefile SHOULD
15 # include all of these definitions. Note that there's no 'OBJS'
16 # definition. The 'rules.mak' file handles that.
18 # Set the target library to make. Note that it is WITHOUT the '.a'
19 # or '.so'. Some systems do not have these endings (e.g. AIX & Windows)
21 # The SRCS definition should list ALL source files.
23 # The HEADERS definition should list ALL header files
25 # RLM_CFLAGS defines addition C compiler flags. You usually don't
26 # want to modify this, though.
28 # The RLM_LIBS definition should list ALL required libraries.
29 # These libraries really should be pulled from the 'config.mak'
30 # definitions, if at all possible. These definitions are also
31 # echoed into another file in ../lib, where they're picked up by
32 # ../main/Makefile for building the version of the server with
33 # statically linked modules.
35 #######################################################################
37 SRCS = rlm_example.c other.c
38 HEADERS = config.h other.h
41 # The name of the module-specific install to call, when
42 # performing a generic install.
44 RLM_INSTALL = install-example
47 # Use the following flags if the compiler is GCC, and you're
50 #RLM_CFLAGS = -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align \
51 # -Wwrite-strings -Wconversion -Wstrict-prototypes \
52 # -Wmissing-prototypes -Wmissing-declarations \
55 RLM_LIBS = $(LIBC_STRCPY)
57 #######################################################################
59 # over-ride the previous assignment of TARGET if we don't have a
60 # definition for LIBC_STRCPY.
62 # The general use for this rule is to NOT build this module if the
63 # libraries it needs aren't installed on the system. e.g. If there's
64 # no LDAP libraries, the rlm_ldap TARGET should be empty.
66 #######################################################################
67 ifeq ($(LIBC_STRCPY),)
71 #######################################################################
73 # Grab the generic rules file for making everything.
75 #######################################################################
78 #######################################################################
80 # We've got a 'config.h' file, so the objects depend on it.
81 # This is so we can reconfigure on the fly, and automatically rebuild
84 # Note that we DO NOT list the '.a' or '.so' files here. This
85 # will make our life easier on systems which do not use '.a' or '.so'.
87 # The file '../rules.mak' defines STATIC_OBJS and DYNAMIC_OBJS
88 # from our SRCS definition, above. This should hopefully hide any
89 # platform-dependent cruft in ../rules.mak.
91 #######################################################################
92 $(STATIC_OBJS): $(HEADERS)
94 $(DYNAMIC_OBJS): $(HEADERS)
96 #######################################################################
98 # A fake example: is strcpy() in libc?
99 # If so, echo 'HAVE_STRCPY=-lc' > ./config.mak
100 # and echo '#define HAVE_STRCPY 1' > ./config.h
102 #######################################################################
104 @../checkconfig -l LIBC_STRCPY strcpy -lc
107 #######################################################################
109 # A fake install example. It does nothing.
111 #######################################################################