Only send a duplicate reply IF such a reply exists, AND if it
[freeradius.git] / src / modules / rlm_example / Makefile
1 #######################################################################
2 #
3 # This rule should be first.
4 #
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.
8 #
9 #######################################################################
10 include config.mak
11
12 #######################################################################
13 #
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.
17 #
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)
20 #
21 # The SRCS definition should list ALL source files.
22 #
23 # The HEADERS definition should list ALL header files
24 #
25 # RLM_CFLAGS defines addition C compiler flags.  You usually don't
26 # want to modify this, though.
27 #
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.
34 #
35 #######################################################################
36 TARGET          = rlm_example
37 SRCS            = rlm_example.c other.c
38 HEADERS         = config.h other.h
39
40 #
41 #  The name of the module-specific install to call, when
42 #  performing a generic install.
43 #
44 RLM_INSTALL     = install-example
45
46 #
47 #  Use the following flags if the compiler is GCC, and you're
48 #  extremely paranoid.
49 #
50 #RLM_CFLAGS     = -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align \
51 #                 -Wwrite-strings -Wconversion -Wstrict-prototypes \
52 #                 -Wmissing-prototypes -Wmissing-declarations \
53 #                 -Wnested-externs
54 RLM_CFLAGS      =
55 RLM_LIBS        = $(LIBC_STRCPY)
56
57 #######################################################################
58 #
59 #  over-ride the previous assignment of TARGET if we don't have a
60 #  definition for LIBC_STRCPY.
61 #
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.
65 #
66 #######################################################################
67 ifeq ($(LIBC_STRCPY),)
68 TARGET=
69 endif
70
71 #######################################################################
72 #
73 #  Grab the generic rules file for making everything.
74 #
75 #######################################################################
76 include ../rules.mak
77
78 #######################################################################
79 #
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
82 #  the libraries.
83 #
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'.
86 #
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.
90 #
91 #######################################################################
92 $(STATIC_OBJS): $(HEADERS)
93
94 $(DYNAMIC_OBJS): $(HEADERS)
95
96 #######################################################################
97 #
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
101 #
102 #######################################################################
103 config.mak config.h:
104         @../checkconfig -l LIBC_STRCPY strcpy -lc
105
106
107 #######################################################################
108 #
109 #  A fake install example.  It does nothing.
110 #
111 #######################################################################
112 install-example:
113         touch .