1 | # Digital Mars C++ |
---|
2 | |
---|
3 | # (C) Copyright Christof Meerwald 2003. |
---|
4 | # (C) Copyright Aleksey Gurtovoy 2004. |
---|
5 | # |
---|
6 | # Distributed under the Boost Software License, Version 1.0. (See |
---|
7 | # accompanying file LICENSE_1_0.txt or copy at |
---|
8 | # http://www.boost.org/LICENSE_1_0.txt) |
---|
9 | |
---|
10 | # The following #// line will be used by the regression test table generation |
---|
11 | # program as the column heading for HTML tables. Must not include version number. |
---|
12 | #//<a href="http://www.digitalmars.com/">Digital<br>Mars C++</a> |
---|
13 | |
---|
14 | set-as-singleton DMC_ROOT DMC_BIN_DIR ; |
---|
15 | |
---|
16 | DMC_COMPILER = dmc ; |
---|
17 | DMC_LINKER = link ; |
---|
18 | DMC_ARCHIVE = lib ; |
---|
19 | |
---|
20 | DMC_ROOT = $(DMC_ROOT:J=" ") ; |
---|
21 | DMC_BIN_DIR ?= "$(DMC_ROOT)"$(SLASH)bin$(SLASH) ; |
---|
22 | |
---|
23 | flags dmc CFLAGS <debug-symbols>on/<debug-store>object : -g ; |
---|
24 | flags dmc LINKFLAGS <debug-symbols>on : -co ; |
---|
25 | |
---|
26 | flags dmc CFLAGS <optimization>off : -S -o+none ; |
---|
27 | flags dmc CFLAGS <optimization>speed : -o+time ; |
---|
28 | flags dmc CFLAGS <optimization>space : -o+space ; |
---|
29 | flags dmc CFLAGS <exception-handling>on : -Ae ; |
---|
30 | flags dmc CFLAGS <rtti>on : -Ar ; |
---|
31 | |
---|
32 | # Note that these two options actually imply multithreading support on DMC |
---|
33 | # because there is no single-threaded dynamic runtime library. Specifying |
---|
34 | # <threading>multi would be a bad idea, though, because no option would be |
---|
35 | # matched when the build uses the default settings of <runtime-link>dynamic |
---|
36 | # and <threading>single. |
---|
37 | flags dmc CFLAGS <runtime-build>release/<runtime-link>dynamic : -ND ; |
---|
38 | flags dmc CFLAGS <runtime-build>debug/<runtime-link>dynamic : -ND ; |
---|
39 | |
---|
40 | flags dmc CFLAGS <runtime-build>release/<runtime-link>static/<threading>single : ; |
---|
41 | flags dmc CFLAGS <runtime-build>debug/<runtime-link>static/<threading>single : ; |
---|
42 | flags dmc CFLAGS <runtime-build>release/<runtime-link>static/<threading>multi : -D_MT ; |
---|
43 | flags dmc CFLAGS <runtime-build>debug/<runtime-link>static/<threading>multi : -D_MT ; |
---|
44 | |
---|
45 | flags dmc CFLAGS <cflags> ; |
---|
46 | flags dmc C++FLAGS <cxxflags> ; |
---|
47 | flags dmc DEFINES <define> ; |
---|
48 | flags dmc UNDEFS <undef> ; |
---|
49 | flags dmc HDRS <include> ; |
---|
50 | flags dmc SYSHDRS <sysinclude> ; |
---|
51 | flags dmc LINKFLAGS <linkflags> ; |
---|
52 | flags dmc ARFLAGS <arflags> ; |
---|
53 | |
---|
54 | flags dmc LIBPATH <library-path> ; |
---|
55 | flags dmc NEEDLIBS <library-file> ; |
---|
56 | flags dmc FINDLIBS <find-library> ; |
---|
57 | flags dmc LINKFLAGS <target-type>$(SHARED_TYPES) : ; |
---|
58 | |
---|
59 | flags msvc STDHDRS : $(DMC_ROOT)$(SLASH)include ; |
---|
60 | |
---|
61 | |
---|
62 | #### Link #### |
---|
63 | |
---|
64 | rule Link-action ( target implib ? : sources + : target-type ? ) |
---|
65 | { |
---|
66 | dmc-Link-action $(<) : $(sources) $(NEEDLIBS) ; |
---|
67 | } |
---|
68 | |
---|
69 | actions together dmc-Link-action |
---|
70 | { |
---|
71 | "$(DMC_BIN_DIR)$(DMC_LINKER)" $(LINKFLAGS) -delexecutable -noi -implib:"$(<[2])" "$(>)" , "$(<[1])" , NUL , user32.lib kernel32.lib "$(FINDLIBS:S=.lib)" , "$(<[2]:B).def" |
---|
72 | } |
---|
73 | |
---|
74 | #### Cc ##### |
---|
75 | |
---|
76 | rule Cc-action |
---|
77 | { |
---|
78 | dmc-Cc-action $(<) : $(>) ; |
---|
79 | } |
---|
80 | |
---|
81 | actions dmc-Cc-action |
---|
82 | { |
---|
83 | "$(DMC_BIN_DIR)$(DMC_COMPILER)" -c -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -I"$(SYSHDRS)" -o"$(<)" "$(>)" |
---|
84 | } |
---|
85 | |
---|
86 | #### C++ #### |
---|
87 | rule C++-action |
---|
88 | { |
---|
89 | dmc-C++-action $(<) : $(>) ; |
---|
90 | } |
---|
91 | |
---|
92 | actions dmc-C++-action |
---|
93 | { |
---|
94 | "$(DMC_BIN_DIR)$(DMC_COMPILER)" -cpp -c -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -I"$(SYSHDRS)" -o"$(<)" "$(>)" |
---|
95 | } |
---|
96 | |
---|
97 | #### Archive #### |
---|
98 | rule Archive-action |
---|
99 | { |
---|
100 | dmc-Archive-action $(<) : $(>) ; |
---|
101 | } |
---|
102 | |
---|
103 | actions together piecemeal dmc-Archive-action |
---|
104 | { |
---|
105 | "$(DMC_BIN_DIR)$(DMC_ARCHIVE)" $(ARFLAGS) -c -n -p128 "$(<)" "$(>)" |
---|
106 | } |
---|