mod.mk 2.01 KB
Newer Older
Kurt Zeilenga's avatar
Kurt Zeilenga committed
1
# $OpenLDAP$
Kurt Zeilenga's avatar
Kurt Zeilenga committed
2
## Copyright 1998-2000 The OpenLDAP Foundation
3
4
5
6
7
8
9
## COPYING RESTRICTIONS APPLY.  See COPYRIGHT File in top level directory
## of this package for details.
##---------------------------------------------------------------------------
##
## Makefile Template for Server Modules
##

10
LIBRARY = $(LIBBASE).la
11
LIBSTAT = lib$(LIBBASE).a
12

Howard Chu's avatar
Howard Chu committed
13
LTFLAGS = --only-$(LINKAGE)
14

15
COMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CFLAGS) $(MODDEFS) -c
Kurt Zeilenga's avatar
Kurt Zeilenga committed
16
17
LTLIBLINK = $(LIBTOOL) $(LTFLAGS) --mode=link -rpath $(moduledir) \
	$(CC) $(CFLAGS) $(LDFLAGS) $(LTVERSION) $(LT_NO_UNDEF)
18
19
20
21
22
23
24
25

MKDEPFLAG = -l

.SUFFIXES: .c .o .lo

.c.lo:
	$(COMPILE) $<

26
all-no lint-no 5lint-no depend-no install-no: FORCE
Howard Chu's avatar
Howard Chu committed
27
28
29
	@echo "run configure with $(BUILD_OPT) to make $(LIBBASE)"

all-common: all-$(BUILD_MOD)
30
31
32
33
34

version.c: $(OBJS)
	$(RM) $@
	$(MKVERSION) $(LIBBASE) > $@

35
$(LIBRARY): $(MODDEPS) version.lo
Kurt Zeilenga's avatar
Kurt Zeilenga committed
36
	$(LTLIBLINK) -module -o $@ $(OBJS) version.lo \
37
	    $(MODLIBS)
38
39

$(LIBSTAT): version.lo
Howard Chu's avatar
Howard Chu committed
40
	$(AR) ruv $@ `echo $(OBJS) | sed 's/\.lo/.o/g'` version.o
41
42
43
44
45
	@$(RANLIB) $@

clean-common: clean-lib FORCE
veryclean-common: veryclean-lib FORCE

Howard Chu's avatar
Howard Chu committed
46
47
48
49
50
51
52
53

lint-common: lint-$(BUILD_MOD)

5lint-common: 5lint-$(BUILD_MOD)

depend-common: depend-$(BUILD_MOD)

install-common: install-$(BUILD_MOD)
54
55

all-local-mod:
56
all-mod: $(LIBRARY) all-local-mod FORCE
57
58

all-local-lib:
Howard Chu's avatar
Howard Chu committed
59
all-yes: $(LIBSTAT) all-local-lib FORCE
60

61
install-mod: $(LIBRARY)
62
63
	@-$(MKDIR) $(DESTDIR)$(moduledir)
	$(LTINSTALL) $(INSTALLFLAGS) -m 755 $(LIBRARY) $(DESTDIR)$(moduledir)
64

65
install-local-lib:
Howard Chu's avatar
Howard Chu committed
66
install-yes: install-local-lib FORCE
67
68

lint-local-lib:
Howard Chu's avatar
Howard Chu committed
69
lint-yes lint-mod: lint-local-lib FORCE
70
71
72
	$(LINT) $(DEFS) $(DEFINES) $(SRCS)

5lint-local-lib:
Howard Chu's avatar
Howard Chu committed
73
5lint-yes 5lint-mod: 5lint-local-lib FORCE
74
75
76
77
	$(5LINT) $(DEFS) $(DEFINES) $(SRCS)

clean-local-lib:
clean-lib: 	clean-local-lib FORCE
Howard Chu's avatar
Howard Chu committed
78
	$(RM) $(LIBRARY) $(LIBSTAT) version.c *.o *.lo a.out core .libs/*
79
80

depend-local-lib:
Howard Chu's avatar
Howard Chu committed
81
82
depend-yes depend-mod: depend-local-lib FORCE
	$(MKDEP) $(DEFS) $(DEFINES) $(SRCS)
83

Howard Chu's avatar
Howard Chu committed
84
85
86
veryclean-local-lib:
veryclean-lib: 	clean-lib veryclean-local-lib

87
Makefile: $(top_srcdir)/build/mod.mk
88