summaryrefslogtreecommitdiff
path: root/include/makeinclude/build_dll.bor
blob: c79e8775747761852d3ca78720b3b71af0e2d386 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#
# $Id$
#
# Rules	for linking a dll
#
# Inputs:
# ~~~~~~~
# NAME - undecorated name of target
# CFLAGS - extra compiler flags	for building target
# CPPDIR - list	of directories containing source files
# OBJFILES - list of (non-system) object files
# LIBFILES - list of (non-system) libraries
# PASCAL - if defined means link dll against pascal run-time library
# DEBUG	- if defined means building with debug information
# UNICODE - if defined when building a unicode dll
#

# Check if the output location was explicitly specified.
!if $d(BASE_BINDIR) || $d(BINDIR)
EXPLICIT_BINDIR = 1
!endif

!ifdef INSTALL_THIS_TARGET
!ifndef EXPLICIT_BINDIR
BINDIR = $(CORE_BINDIR)
!endif
!endif

!include <$(ACE_ROOT)\include\makeinclude\decorator.bor>
!include <$(ACE_ROOT)\include\makeinclude\outputdir.bor>
!include <$(ACE_ROOT)\include\makeinclude\compiler.bor>

!ifdef NAME
!ifndef TARGET
TARGET = $(BINDIR)\$(NAME)$(LIB_DECORATOR).dll
!endif
!ifndef INSTALL_THIS_TARGET
!ifndef EXPLICIT_BINDIR
CORE_TARGET = $(CORE_BINDIR)\$(NAME)$(LIB_DECORATOR).dll
!endif
!endif
!endif

all: $(TARGET) $(CORE_TARGET)
	@echo Do nothing >NUL

!ifdef TARGET
$(TARGET): $(OBJFILES) $(RESOURCE)
	@$(MAKE_BINDIR)
	$(LD) @&&!
	$(COMMON_LFLAGS) $(DLL_LFLAGS) $(LFLAGS) +
	$(DLL_STARTUP_OBJ) $(LIBFILES) $(OBJFILES),	+
	$(TARGET),, +
	$(COMMON_LIBS),, +
	$(RESOURCE)
!
!ifndef	DEBUG
	@del $(TARGET:.dll=.tds)
!endif
!ifdef CORE_TARGET
$(CORE_TARGET): $(TARGET)
	@copy $(TARGET) $(CORE_TARGET) >NUL
!ifdef DEBUG
	@copy $(TARGET:.dll=.tds) $(CORE_TARGET:.dll=.tds) >NUL
!endif
!endif
!endif

!include <$(ACE_ROOT)\include\makeinclude\clean.bor>

INSTALL_TYPES =	dll lib	includes

!include <$(ACE_ROOT)\include\makeinclude\install.bor>

!ifdef CPPDIR
.path.cpp = $(CPPDIR)
!endif

!ifdef CDIR
.path.c	= $(CDIR)
!endif

!ifdef RESDIR
.path.rc = $(RESDIR)
!else
.path.rc = .
!endif

.path.$(OBJ_EXT) = $(OBJDIR)

!ifdef DEBUG
!ifndef NO_FULL_PATH
USE_FULL_PATH = 1
!endif
!endif

.cpp.$(OBJ_EXT):
	@$(MAKE_OBJDIR)
!ifdef USE_FULL_PATH
	@for /F "delims=;" %i in ('cd') do @echo $(CC) $(COMMON_CFLAGS) $(DLL_CFLAGS) $(CFLAGS) -c -n$(@D) %i\$(<:.\=)
	@for /F "delims=;" %i in ('cd') do @$(CC) $(COMMON_CFLAGS) $(DLL_CFLAGS) $(CFLAGS) -c -n$(@D) %i\$(<:.\=)
!else
	$(CC) $(COMMON_CFLAGS) $(DLL_CFLAGS) $(CFLAGS) -c -n$(@D) $<
!endif

.c.$(OBJ_EXT):
	@$(MAKE_OBJDIR)
!ifdef USE_FULL_PATH
	@for /F "delims=;" %i in ('cd') do @echo $(CC) $(COMMON_CFLAGS) $(DLL_CFLAGS) $(CFLAGS) -c -n$(@D) %i\$(<:.\=)
	@for /F "delims=;" %i in ('cd') do @$(CC) $(COMMON_CFLAGS) $(DLL_CFLAGS) $(CFLAGS) -c -n$(@D) %i\$(<:.\=)
!else
	$(CC) $(COMMON_CFLAGS) $(DLL_CFLAGS) $(CFLAGS) -c -n$(@D) $<
!endif

.rc.res:
	@$(MAKE_OBJDIR)
	$(RC) -fo$@ $<

.autodepend