mod.mk 2.13 KB
Newer Older
Kurt Zeilenga's avatar
Kurt Zeilenga committed
1
# $OpenLDAP$
Kurt Zeilenga's avatar
Kurt Zeilenga committed
2
3
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
##
Quanah Gibson-Mount's avatar
Quanah Gibson-Mount committed
4
## Copyright 1998-2020 The OpenLDAP Foundation.
Kurt Zeilenga's avatar
Kurt Zeilenga committed
5
## All rights reserved.
6
##
Kurt Zeilenga's avatar
Kurt Zeilenga committed
7
8
9
## Redistribution and use in source and binary forms, with or without
## modification, are permitted only as authorized by the OpenLDAP
## Public License.
10
##
Kurt Zeilenga's avatar
Kurt Zeilenga committed
11
12
13
14
15
16
17
## A copy of this license is available in the file LICENSE in the
## top-level directory of the distribution or, alternatively, at
## <http://www.OpenLDAP.org/license.html>.
##---------------------------------------------------------------------------
#
# Makefile Template for Server Modules
#
18

19
LIBRARY = $(LIBBASE).la
20
LIBSTAT = lib$(LIBBASE).a
21
22
23
24
25
26

MKDEPFLAG = -l

.SUFFIXES: .c .o .lo

.c.lo:
Howard Chu's avatar
Howard Chu committed
27
	$(LTCOMPILE_MOD) $<
28

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

all-common: all-$(BUILD_MOD)
33

Howard Chu's avatar
Howard Chu committed
34
version.c: Makefile
35
36
37
	$(RM) $@
	$(MKVERSION) $(LIBBASE) > $@

Howard Chu's avatar
Howard Chu committed
38
version.lo: version.c $(OBJS)
Howard Chu's avatar
Howard Chu committed
39

Howard Chu's avatar
Howard Chu committed
40
41
$(LIBRARY): version.lo
	$(LTLINK_MOD) -module -o $@ $(OBJS) version.lo $(LINK_LIBS)
42
43

$(LIBSTAT): version.lo
Howard Chu's avatar
Howard Chu committed
44
	$(AR) ruv $@ `echo $(OBJS) | sed 's/\.lo/.o/g'` version.o
45
46
47
48
49
	@$(RANLIB) $@

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

Howard Chu's avatar
Howard Chu committed
50
51
52
53
54
55
56
57

lint-common: lint-$(BUILD_MOD)

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

depend-common: depend-$(BUILD_MOD)

install-common: install-$(BUILD_MOD)
58
59

all-local-mod:
60
all-mod: $(LIBRARY) all-local-mod FORCE
61
62

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

65
install-mod: $(LIBRARY)
66
67
	@-$(MKDIR) $(DESTDIR)$(moduledir)
	$(LTINSTALL) $(INSTALLFLAGS) -m 755 $(LIBRARY) $(DESTDIR)$(moduledir)
68

69
install-local-lib:
Howard Chu's avatar
Howard Chu committed
70
install-yes: install-local-lib FORCE
71
72

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

5lint-local-lib:
Howard Chu's avatar
Howard Chu committed
77
5lint-yes 5lint-mod: 5lint-local-lib FORCE
78
79
80
81
	$(5LINT) $(DEFS) $(DEFINES) $(SRCS)

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

depend-local-lib:
Howard Chu's avatar
Howard Chu committed
85
86
depend-yes depend-mod: depend-local-lib FORCE
	$(MKDEP) $(DEFS) $(DEFINES) $(SRCS)
87

Howard Chu's avatar
Howard Chu committed
88
89
90
veryclean-local-lib:
veryclean-lib: 	clean-lib veryclean-local-lib

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