]> git.sur5r.net Git - openldap/blob - build/mod.mk
* build/top.mk: removed references to TMPROOT and added DESTDIR support
[openldap] / build / mod.mk
1 # $OpenLDAP$
2 ## Copyright 1998,1999 The OpenLDAP Foundation
3 ## COPYING RESTRICTIONS APPLY.  See COPYRIGHT File in top level directory
4 ## of this package for details.
5 ##---------------------------------------------------------------------------
6 ##
7 ## Makefile Template for Server Modules
8 ##
9
10 LIBRARY = $(LIBBASE).la
11 LIBSTAT = lib$(LIBBASE).a
12 LTFLAGS = --only-$(LINKAGE)
13
14 all-no lint-no 5lint-no depend-no install-no: FORCE
15         @echo "run configure with $(BUILD_OPT) to make $(LIBBASE)"
16
17 all-common: all-$(BUILD_MOD)
18
19 version.c: $(OBJS)
20         $(RM) $@
21         $(MKVERSION) $(LIBBASE) > $@
22
23 $(LIBRARY): version.lo
24         $(LTLIBLINK) -module -rpath $(moduledir) -o $@ $(OBJS) version.lo
25
26 $(LIBSTAT): version.lo
27         $(AR) ruv $@ `echo $(OBJS) | sed 's/\.lo/.o/g'` version.o
28         @$(RANLIB) $@
29
30 clean-common: clean-lib FORCE
31 veryclean-common: veryclean-lib FORCE
32
33
34 lint-common: lint-$(BUILD_MOD)
35
36 5lint-common: 5lint-$(BUILD_MOD)
37
38 depend-common: depend-$(BUILD_MOD)
39
40 install-common: install-$(BUILD_MOD)
41
42 all-local-mod:
43 all-mod: $(LIBRARY) all-local-mod FORCE
44
45 all-local-lib:
46 all-yes: $(LIBSTAT) all-local-lib FORCE
47
48 install-mod: $(LIBRARY)
49         @-$(MKDIR) $(DESTDIR)$(moduledir)
50         $(LTINSTALL) $(INSTALLFLAGS) -m 755 $(LIBRARY) $(DESTDIR)$(moduledir)
51
52 install-local-lib:
53 install-yes: install-local-lib FORCE
54
55 lint-local-lib:
56 lint-yes lint-mod: lint-local-lib FORCE
57         $(LINT) $(DEFS) $(DEFINES) $(SRCS)
58
59 5lint-local-lib:
60 5lint-yes 5lint-mod: 5lint-local-lib FORCE
61         $(5LINT) $(DEFS) $(DEFINES) $(SRCS)
62
63 clean-local-lib:
64 clean-lib:      clean-local-lib FORCE
65         $(RM) $(LIBRARY) $(LIBSTAT) version.c *.o *.lo a.out core .libs/*
66
67 depend-local-lib:
68 depend-yes depend-mod: depend-local-lib FORCE
69         $(MKDEP) $(DEFS) $(DEFINES) $(SRCS)
70
71 veryclean-local-lib:
72 veryclean-lib:  clean-lib veryclean-local-lib
73
74 COMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CFLAGS) -c
75 MKDEPFLAG = -l
76
77 .SUFFIXES: .c .o .lo
78
79 .c.lo:
80         $(COMPILE) $<
81
82 Makefile: $(top_srcdir)/build/mod.mk