summaryrefslogtreecommitdiffstats
path: root/ldap/nsdeps.mk
blob: ff2d30a9166c98e824b02ee452e350da910ff472 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
57
58
59
#
# BEGIN COPYRIGHT BLOCK
# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
# Copyright (C) 2005 Red Hat, Inc.
# All rights reserved.
# END COPYRIGHT BLOCK
#
#
#  build dependency lists if necessary, then make 'build.mk'
#
#  only build dependency lists on platforms that it works on...
#


ifeq ($(ARCH), WINNT)
# windows can't make dot-files:
DEPFILE = ./deps
$(OBJDIR)/mkdep: $(LDAP_SRC)/servers/slapd/tools/mkdep.c
	$(CC) /Ox /DWINNT /Fe$(OBJDIR)/mkdep.exe \
		$(LDAP_SRC)/servers/slapd/tools/mkdep.c
else
DEPFILE = ./.deps
$(OBJDIR)/mkdep: $(LDAP_SRC)/servers/slapd/tools/mkdep.c
	$(CC) -o $(OBJDIR)/mkdep $(LDAP_SRC)/servers/slapd/tools/mkdep.c
endif

ifeq ($(RECURSIVE_DEP), yes)
$(DEPFILE): *.h *.c
	@echo Cant seem to create $(DEPFILE), time to die.
	@exit 1
else
$(DEPFILE): *.h *.c
	@echo Rebuilding dependency lists...
	$(OBJDIR)/mkdep -o $(OBJDEST) *.h *.c >$(DEPFILE)
	$(MAKE) RECURSIVE_DEP=yes
endif

#
# you can override these from the command line
#
ifeq ($(ARCH), SOLARIS)
USE_DEPS = no
endif
ifeq ($(ARCH), Linux)
USE_DEPS = no
endif
ifeq ($(ARCH), WINNT)
USE_DEPS = no
endif


# automatic dependency checking?
ifeq ($(USE_DEPS), yes)
  ifeq ($(RECURSIVE_DEP), yes)
    include $(DEPFILE)
  else
    BUILD_DEP = $(OBJDIR)/mkdep $(DEPFILE)
  endif
endif