3 # For simple modules with no significant dependencies, set $(TITLE)
4 # and include this file.
6 # There are a few ways to customize this set of rules. Namely, define
8 # $(MODULE_SIMPLE_EXTRACLEAN)
9 # $(MODULE_SIMPLE_CLEAN)
10 # $(MODULE_SIMPLE_REMOVE)
11 # $(MODULE_SIMPLE_INSTALL)
12 # $(MODULE_SIMPLE_EXTRALIBS) - other things to link with the module
13 # $(MODULE_SIMPLE_EXTRAFILES) - other files to build (no .c suffix)
16 LIBFILES = $(TITLE) $(MODULE_SIMPLE_EXTRAFILES)
17 LIBSRC = $(addsuffix .c,$(LIBFILES))
18 LIBOBJ = $(addsuffix .o,$(LIBFILES))
19 LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
20 LIBOBJS = $(addprefix static/,$(LIBOBJ))
22 LINK_PAMMODUTILS = -L../pammodutil -lpammodutil
23 INCLUDE_PAMMODUTILS = -I../pammodutil/include
26 LIBSHARED = $(TITLE).so
30 LIBSTATIC = lib$(TITLE).o
33 ####################### don't edit below #######################
35 all: dirs $(LIBSHARED) $(LIBSTATIC) register
38 $(CC) $(CFLAGS) $(INCLUDE_PAMMODUTILS) $(DYNAMIC) $(TARGET_ARCH) -c $< -o $@
41 $(CC) $(CFLAGS) $(INCLUDE_PAMMODUTILS) $(STATIC) $(TARGET_ARCH) -c $< -o $@
53 ( cd .. ; ./register_static $(TITLE) $(TITLE)/$(LIBSTATIC) )
61 $(LIBSHARED): $(LIBOBJD)
62 $(LD_D) -o $@ $(LIBOBJD) $(MODULE_SIMPLE_EXTRALIBS) $(NEED_LINK_LIB_C) $(LINK_PAMMODUTILS)
71 $(LIBSTATIC): $(LIBOBJS)
72 $(LD) -r -o $@ $(LIBOBJS) $(MODULE_SIMPLE_EXTRALIBS) $(LINK_PAMMODUTILS)
76 $(MKDIR) $(FAKEROOT)$(SECUREDIR)
78 $(INSTALL) -m $(SHLIBMODE) $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)
80 $(MODULE_SIMPLE_INSTALL)
83 rm -f $(FAKEROOT)$(SECUREDIR)/$(TITLE).so
84 $(MODULE_SIMPLE_REMOVE)
87 rm -f $(LIBOBJD) $(LIBOBJS) core *~
88 $(MODULE_SIMPLE_CLEAN)
89 rm -f *.a *.o *.so *.bak
91 $(MODULE_SIMPLE_EXTRACLEAN)