summaryrefslogtreecommitdiff
path: root/modules/Simple.Rules
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2000-11-19 23:31:22 +0000
committerAndrew G. Morgan <morgan@kernel.org>2000-11-19 23:31:22 +0000
commit47575925596c2af2a78c009fcdd14de72fc82d3e (patch)
tree2c353e5c8dc7a2b019b1d30853957021af631a42 /modules/Simple.Rules
parent8c7e950878780872acf82e924f58369c907ddbcb (diff)
Relevant BUGIDs: task 15788, bugs 108297, 117476, 117474
Purpose of commit: merge in the autoconf stuff Commit summary: --------------- this is a merge of the 0-72 autoconf branch to something more up to date. This commit will be followed by merging this Linux-PAM-0-73pre-autoconf branch to the main trunk.
Diffstat (limited to 'modules/Simple.Rules')
-rw-r--r--modules/Simple.Rules90
1 files changed, 90 insertions, 0 deletions
diff --git a/modules/Simple.Rules b/modules/Simple.Rules
new file mode 100644
index 00000000..be56e1d3
--- /dev/null
+++ b/modules/Simple.Rules
@@ -0,0 +1,90 @@
+# $Id$
+#
+# For simple modules with no significant dependencies, set $(TITLE)
+# and include this file.
+#
+# There are a few ways to customize this set of rules. Namely, define
+#
+# $(MODULE_SIMPLE_EXTRACLEAN)
+# $(MODULE_SIMPLE_CLEAN)
+# $(MODULE_SIMPLE_REMOVE)
+# $(MODULE_SIMPLE_INSTALL)
+# $(MODULE_SIMPLE_EXTRALIBS) - other things to link with the module
+#
+
+LIBSRC = $(TITLE).c
+LIBOBJ = $(TITLE).o
+LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
+LIBOBJS = $(addprefix static/,$(LIBOBJ))
+
+ifdef DYNAMIC
+LIBSHARED = $(TITLE).so
+endif
+
+ifdef STATIC
+LIBSTATIC = lib$(TITLE).o
+endif
+
+####################### don't edit below #######################
+
+all: dirs $(LIBSHARED) $(LIBSTATIC) register
+
+dynamic/%.o : %.c
+ $(CC) $(CFLAGS) $(DYNAMIC) $(TARGET_ARCH) -c $< -o $@
+
+static/%.o : %.c
+ $(CC) $(CFLAGS) $(STATIC) $(TARGET_ARCH) -c $< -o $@
+
+dirs:
+ifdef DYNAMIC
+ $(MKDIR) ./dynamic
+endif
+ifdef STATIC
+ $(MKDIR) ./static
+endif
+
+register:
+ifdef STATIC
+ ( cd .. ; ./register_static $(TITLE) $(TITLE)/$(LIBSTATIC) )
+endif
+
+ifdef DYNAMIC
+$(LIBOBJD): $(LIBSRC)
+endif
+
+ifdef DYNAMIC
+$(LIBSHARED): $(LIBOBJD)
+ $(LD_D) -o $@ $(LIBOBJD) $(MODULE_SIMPLE_EXTRALIBS) $(NEED_LINK_LIB_C)
+
+endif
+
+ifdef STATIC
+$(LIBOBJS): $(LIBSRC)
+endif
+
+ifdef STATIC
+$(LIBSTATIC): $(LIBOBJS)
+ $(LD) -r -o $@ $(LIBOBJS) $(MODULE_SIMPLE_EXTRALIBS)
+endif
+
+install: all
+ $(MKDIR) $(FAKEROOT)$(SECUREDIR)
+ifdef DYNAMIC
+ $(INSTALL) -m $(SHLIBMODE) $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)
+endif
+ $(MODULE_SIMPLE_INSTALL)
+
+remove:
+ rm -f $(FAKEROOT)$(SECUREDIR)/$(TITLE).so
+ $(MODULE_SIMPLE_REMOVE)
+
+clean:
+ rm -f $(LIBOBJD) $(LIBOBJS) core *~
+ $(MODULE_SIMPLE_CLEAN)
+ rm -f *.a *.o *.so *.bak
+ rm -rf dynamic static
+ $(MODULE_SIMPLE_EXTRACLEAN)
+
+.c.o:
+ $(CC) $(CFLAGS) -c $<
+