mod.mk 1.87 KB
Newer Older
Kurt Zeilenga's avatar
Kurt Zeilenga committed
1
# $OpenLDAP$
2
3
4
5
6
7
8
9
## Copyright 1998,1999 The OpenLDAP Foundation
## 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
Howard Chu's avatar
Howard Chu committed
12
LTFLAGS = --only-$(LINKAGE)
13

14
all-no lint-no 5lint-no depend-no install-no: FORCE
Howard Chu's avatar
Howard Chu committed
15
16
17
	@echo "run configure with $(BUILD_OPT) to make $(LIBBASE)"

all-common: all-$(BUILD_MOD)
18
19
20
21
22
23

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

$(LIBRARY): version.lo
24
	$(LTLIBLINK) -module -rpath $(moduledir) -o $@ $(OBJS) version.lo
25
26

$(LIBSTAT): version.lo
Howard Chu's avatar
Howard Chu committed
27
	$(AR) ruv $@ `echo $(OBJS) | sed 's/\.lo/.o/g'` version.o
28
29
30
31
32
	@$(RANLIB) $@

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

Howard Chu's avatar
Howard Chu committed
33
34
35
36
37
38
39
40

lint-common: lint-$(BUILD_MOD)

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

depend-common: depend-$(BUILD_MOD)

install-common: install-$(BUILD_MOD)
41
42

all-local-mod:
43
all-mod: $(LIBRARY) all-local-mod FORCE
44
45

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

48
install-mod: $(LIBRARY)
49
50
	@-$(MKDIR) $(DESTDIR)$(moduledir)
	$(LTINSTALL) $(INSTALLFLAGS) -m 755 $(LIBRARY) $(DESTDIR)$(moduledir)
51

52
install-local-lib:
Howard Chu's avatar
Howard Chu committed
53
install-yes: install-local-lib FORCE
54
55

lint-local-lib:
Howard Chu's avatar
Howard Chu committed
56
lint-yes lint-mod: lint-local-lib FORCE
57
58
59
	$(LINT) $(DEFS) $(DEFINES) $(SRCS)

5lint-local-lib:
Howard Chu's avatar
Howard Chu committed
60
5lint-yes 5lint-mod: 5lint-local-lib FORCE
61
62
63
64
	$(5LINT) $(DEFS) $(DEFINES) $(SRCS)

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

depend-local-lib:
Howard Chu's avatar
Howard Chu committed
68
69
depend-yes depend-mod: depend-local-lib FORCE
	$(MKDEP) $(DEFS) $(DEFINES) $(SRCS)
70

Howard Chu's avatar
Howard Chu committed
71
72
73
veryclean-local-lib:
veryclean-lib: 	clean-lib veryclean-local-lib

74
75
76
77
78
79
80
81
82
COMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CFLAGS) -c
MKDEPFLAG = -l

.SUFFIXES: .c .o .lo

.c.lo:
	$(COMPILE) $<

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