-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
143 lines (119 loc) · 3.35 KB
/
Copy pathmakefile
File metadata and controls
143 lines (119 loc) · 3.35 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# NMAKE makefile for building the Library Reference Manual.
#
# This builds all program components and then builds the library reference
# manual based on the Adv3 library files.
#
# You'll need the Microsoft C# and C++ compilers to use this makefile.
# Also, you'll need a standard Linux-style "sed" program - you can get
# one of these from the Cygwin distribution.
#
# Before running this makefile, you should check the
#
# Build configuration - DEBUG or release
#
!ifdef DEBUG
CFLAGS_DBG = -Zi -Od
LDFLAGS_DBG = /debug
CSCFLAGS_DBG = /debug /define:DEBUG;TRACE
!else
CFLAGS_DBG =
LDFLAGS_DBG =
CSCFLAGS_DBG =
!endif
#
# Directory configuration
#
TADSROOT = ..\..\..
TADSBUILD = $(TADSROOT)\build
T3LIB = $(TADSBUILD)\lib
T3INC = $(TADSBUILD)\include
ADV3LIB = $(TADSBUILD)\lib\adv3
HTMLOUTDIR = $(TADSBUILD)\doc\libref
# local output directories
BINDIR = bin\Debug
MERGEDIR = ppmerge
#
# Tool configuration
#
CSCFLAGS = \
/incremental /baseaddress:285212672 /filealign:4096 /warn:4 \
$(CSCFLAGS_DBG)
CSC = csc
CC = cl
CFLAGS = $(CFLAGS_DBG)
LD = link
LDFLAGS = $(LDFLAGS_DBG)
#
# Main target
#
all: $(HTMLOUTDIR)\ClassIndex.html
# cleanup
clean:
if exist $(MERGEDIR)\*.t del $(MERGEDIR)\*.t
if exist $(MERGEDIR)\*.t.p del $(MERGEDIR)\*.t.p
if exist $(BINDIR)\*.obj del $(BINDIR)\*.obj
if exist $(BINDIR)\*.exe del $(BINDIR)\*.exe
if exist $(BINDIR)\*.bat del $(BINDIR)\*.bat
# Adv3 and T3 system library source list
LIBSOURCES = \
$(T3LIB)\*.t \
$(T3INC)\*.h \
$(ADV3LIB)\*.t \
$(ADV3LIB)\*.h \
$(ADV3LIB)\en_us\*.t \
$(ADV3LIB)\en_us\*.h
# the Library Reference Manual
$(HTMLOUTDIR)\ClassIndex.html: \
$(BINDIR)\docgen.exe \
$(LIBSOURCES) \
$(MERGEDIR)\thing.t \
$(BINDIR)\verid.txt \
libref.css \
*.jpg \
Intro.html
$(BINDIR)\docgen -m $(MERGEDIR) -i Intro.html -o $(HTMLOUTDIR) \
-vf $(BINDIR)\verid.txt $(LIBSOURCES)
copy libref.css $(HTMLOUTDIR)\*.*
copy *.jpg $(HTMLOUTDIR)\*.*
# extract version information from the Adv3 library
$(BINDIR)\verid.txt: $(ADV3LIB)\modid.t $(BINDIR)\getver.bat
for /f %%i in ('$(BINDIR)\getver $(ADV3LIB)\modid.t') do echo %%i>$@
$(BINDIR)\getver.bat: makefile
rem <<$(BINDIR)\getver.bat
@grep -E "^ version = '[0-9]+[.][0-9]+[.][0-9]+([.][0-9]+)?'" %1 | sed -r "s/ +version = '(.+)'/\1/"
<<KEEP
# preprocessor merging
$(MERGEDIR)\thing.t: \
$(BINDIR)\ppmerge.exe \
$(ADV3LIB)\*.t \
$(ADV3LIB)\en_us\*.t \
$(BINDIR)\do_merge.bat
$(BINDIR)\do_merge
$(BINDIR)\do_merge.bat: makefile
rem <<$(BINDIR)\do_merge.bat
set origdir=%CD%
pushd $(ADV3LIB)
for %%i in (*.t) do (
t3make -q -P -I. %%i > %origdir%\$(MERGEDIR)\%%i.p
%origdir%\$(BINDIR)\ppmerge %%i %origdir%\$(MERGEDIR)\%%i.p %origdir%\$(MERGEDIR)\%%i
del %origdir%\$(MERGEDIR)\%%i.p
)
cd en_us
for %%i in (*.t) do (
t3make -q -P -I. -I.. %%i > %origdir%\$(MERGEDIR)\%%i.p
%origdir%\$(BINDIR)\ppmerge %%i %origdir%\$(MERGEDIR)\%%i.p %origdir%\$(MERGEDIR)\%%i
del %origdir%\$(MERGEDIR)\%%i.p
)
popd
<<KEEP
# DocGen program
$(BINDIR)\docgen.exe: *.cs
$(CSC) $(CSCFLAGS) /out:$@ $**
# preprocessor merge program
$(BINDIR)\ppmerge.exe: $(BINDIR)\ppmerge.obj
$(LD) $(LDFLAGS) /out:$@ $**
$(BINDIR)\ppmerge.obj: ppmerge.cpp
# generic rules
.SUFFIXES:.cpp.obj
.cpp{$(BINDIR)}.obj:
$(CC) $(CFLAGS) -c -Fo$@ $<