mod.mk 2.43 KB
Newer Older
1
2
3
4
5
6
7
8
## 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
##

9
LIBRARY = $(LIBBASE).la
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
LIBSTAT = lib$(LIBBASE).a

all-common: FORCE
	@if test "$(BUILD_MOD)" = "yes"; then \
		$(MAKE) $(MFLAGS) LTFLAGS=--only-shared all-mod; \
	elif test "$(BUILD_LIB)" = "yes" ; then \
		$(MAKE) $(MFLAGS) LTFLAGS=--only-static all-lib; \
	else \
		echo "run configure with $(BUILD_OPT) to build $(LIBBASE)"; \
	fi

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

$(LIBRARY): version.lo
26
	$(LTLIBLINK) -module -rpath $(moduledir) -o $@ $(OBJS) version.lo
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

$(LIBSTAT): version.lo
	$(AR) ruv $@ `echo $(OBJS) | sed s/\.lo/.o/g` version.o
	@$(RANLIB) $@

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

lint-common: FORCE
	@if test "$(BUILD_LIB)" = "yes" ; then \
		$(MAKE) $(MFLAGS) lint-lib; \
	else \
		echo "run configure with $(BUILD_OPT) to lint $(LIBBASE)"; \
	fi

5lint-common: FORCE
	@if test "$(BUILD_LIB)" = "yes" ; then \
		$(MAKE) $(MFLAGS) 5lint-lib; \
	else \
		echo "run configure with $(BUILD_OPT) to 5lint $(LIBBASE)"; \
	fi

depend-common: FORCE
	@if test "$(BUILD_LIB)" = "yes" ; then \
		$(MAKE) $(MFLAGS) depend-lib; \
	else \
		echo "run configure with $(BUILD_OPT) to depend $(LIBBASE)"; \
	fi

install-common: FORCE
57
58
59
	@if test "$(BUILD_MOD)" = "yes" ; then \
		$(MAKE) $(MFLAGS) install-mod; \
	elif test "$(BUILD_LIB)" = "yes" ; then \
60
61
62
63
64
65
		$(MAKE) $(MFLAGS) install-lib; \
	else \
		echo "run configure with $(BUILD_OPT) to install $(LIBBASE)"; \
	fi

all-local-mod:
66
all-mod: $(LIBRARY) all-local-mod FORCE
67
68
69
70

all-local-lib:
all-lib: $(LIBSTAT) all-local-lib FORCE

71
72
73
74
install-mod: $(LIBRARY)
	@-$(MKDIR) $(moduledir)
	$(LTINSTALL) $(INSTALLFLAGS) -m 755 $(LIBRARY) $(moduledir)

75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
install-local-lib:
install-lib: install-local-lib FORCE

lint-local-lib:
lint-lib: lint-local-lib FORCE
	$(LINT) $(DEFS) $(DEFINES) $(SRCS)

5lint-local-lib:
5lint-lib: 5lint-local-lib FORCE
	$(5LINT) $(DEFS) $(DEFINES) $(SRCS)

clean-local-lib:
clean-lib: 	clean-local-lib FORCE
	$(RM) $(LIBRARY) $(LIBSTAT) $(MODULE) *.o *.lo a.out core .libs/*

depend-local-lib:
depend-lib: depend-local-lib FORCE

COMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CFLAGS) -c
MKDEPFLAG = -l

.SUFFIXES: .c .o .lo

.c.lo:
	$(COMPILE) $<

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