comparison prism-d3d-native/Makefile @ 4047:937a1432ee79

Gradle build. Seriously, getting it right this time.
author Richard Bair <richard.bair@oracle.com>
date Mon, 24 Jun 2013 13:54:44 -0700
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:18922f8af2a1
1 #
2 # There exist several targets which are by default empty and which can be
3 # used for execution of your targets. These targets are usually executed
4 # before and after some main targets. They are:
5 #
6 # .build-pre: called before 'build' target
7 # .build-post: called after 'build' target
8 # .clean-pre: called before 'clean' target
9 # .clean-post: called after 'clean' target
10 # .clobber-pre: called before 'clobber' target
11 # .clobber-post: called after 'clobber' target
12 # .all-pre: called before 'all' target
13 # .all-post: called after 'all' target
14 # .help-pre: called before 'help' target
15 # .help-post: called after 'help' target
16 #
17 # Targets beginning with '.' are not intended to be called on their own.
18 #
19 # Main targets can be executed directly, and they are:
20 #
21 # build build a specific configuration
22 # clean remove built files from a configuration
23 # clobber remove all built files
24 # all build all configurations
25 # help print help mesage
26 #
27 # Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
28 # .help-impl are implemented in nbproject/makefile-impl.mk.
29 #
30 # NOCDDL
31
32
33 # Environment
34 MKDIR = mkdir
35 CP = cp
36 CCADMIN = CCadmin
37 RANLIB = ranlib
38
39 # NOTE: the following variables are passed in from
40 # the prism-d3d/build.xml file
41 ifndef DIST_DIR
42 DIST_DIR = dist
43 endif
44 ifndef BUILD_DIR
45 BUILD_DIR = build
46 endif
47 ifndef PRISM_D3D_CLASS_DIR
48 PRISM_D3D_CLASS_DIR = ../prism-d3d/build/classes
49 endif
50 ifndef PRISM_DEP_CP
51 PRISM_DEP_CP = ../prism-ps/build/classes\;../prism-common/build/classes\;../javafx-geom/build/classes\;../glass/glass/build/classes
52 endif
53 ifndef FXC_ARCH
54 FXC_ARCH = x86
55 endif
56 ifndef CONF
57 CONF = Release
58 endif
59
60 SRC_DIR = src
61 PRISM_LIB = $(DIST_DIR)/prism-d3d.dll
62 PRISM_MAP = $(DIST_DIR)/prism-d3d.map
63 PRISM_PDB = $(DIST_DIR)/prism-d3d.pdb
64 PRISM_PKG = com.sun.prism.d3d
65 PRISM_PKG_PATH = $(subst .,/,$(PRISM_PKG))
66 PRISM_JNI_PKG = $(subst .,_,$(PRISM_PKG))
67
68 SRC_HLSL_3D_DIR = $(SRC_DIR)/hlsl
69 BUILD_HLSL_3D_DIR = $(BUILD_DIR)/hlsl
70
71 JNI_INCLUDES = \
72 $(BUILD_DIR)/$(PRISM_JNI_PKG)_D3DContext.h \
73 $(BUILD_DIR)/$(PRISM_JNI_PKG)_D3DGraphics.h \
74 $(BUILD_DIR)/$(PRISM_JNI_PKG)_D3DPipeline.h \
75 $(BUILD_DIR)/$(PRISM_JNI_PKG)_D3DResourceFactory.h \
76 $(BUILD_DIR)/$(PRISM_JNI_PKG)_D3DShader.h \
77 $(BUILD_DIR)/$(PRISM_JNI_PKG)_D3DSwapChain.h \
78 $(BUILD_DIR)/$(PRISM_JNI_PKG)_D3DVertexBuffer.h
79
80 INCLUDES = \
81 $(SRC_DIR)/D3DBadHardware.h \
82 $(SRC_DIR)/D3DContext.h \
83 $(SRC_DIR)/D3DPipeline.h \
84 $(SRC_DIR)/D3DPipelineManager.h \
85 $(SRC_DIR)/D3DResourceManager.h \
86 $(SRC_DIR)/TextureUploader.h \
87 $(SRC_DIR)/Trace.h \
88 $(SRC_DIR)/interface.h \
89 $(SRC_DIR)/D3DLight.h \
90 $(SRC_DIR)/D3DMesh.h \
91 $(SRC_DIR)/D3DMeshView.h \
92 $(SRC_DIR)/D3DPhongMaterial.h \
93 $(SRC_DIR)/D3DPhongShader.h
94
95 HLSL_3D_INCLUDES = \
96 $(SRC_HLSL_3D_DIR)/devColor.h \
97 $(SRC_HLSL_3D_DIR)/psConstants.h \
98 $(SRC_HLSL_3D_DIR)/psMath.h \
99 $(SRC_HLSL_3D_DIR)/psConstants.h \
100 $(SRC_HLSL_3D_DIR)/vs2ps.h \
101 $(SRC_HLSL_3D_DIR)/vsConstants.h \
102 $(SRC_HLSL_3D_DIR)/vsDecl.h \
103 $(SRC_HLSL_3D_DIR)/vsMath.h
104
105 VS_SRC = $(SRC_DIR)/PassThroughVS.hlsl
106 VS_INCLUDE = $(BUILD_DIR)/PassThroughVS.h
107
108 PS_3D_SRC = $(SRC_HLSL_3D_DIR)/Mtl1PS.hlsl
109 PS_3D_INCLUDE = $(BUILD_HLSL_3D_DIR)/Mtl1PS.h
110
111 VS_3D_SRC = $(SRC_HLSL_3D_DIR)/Mtl1VS.hlsl
112 VS_3D_INCLUDE = $(BUILD_HLSL_3D_DIR)/Mtl1VS_Obj.h
113
114 OBJS = \
115 $(BUILD_DIR)/D3DGraphics.obj \
116 $(BUILD_DIR)/D3DPipeline.obj \
117 $(BUILD_DIR)/D3DPipelineManager.obj \
118 $(BUILD_DIR)/D3DResourceManager.obj \
119 $(BUILD_DIR)/D3DResourceFactory.obj \
120 $(BUILD_DIR)/D3DContext.obj \
121 $(BUILD_DIR)/D3DContextInit.obj \
122 $(BUILD_DIR)/D3DShader.obj \
123 $(BUILD_DIR)/TextureUploader.obj \
124 $(BUILD_DIR)/D3DLight.obj \
125 $(BUILD_DIR)/D3DMesh.obj \
126 $(BUILD_DIR)/D3DMeshView.obj \
127 $(BUILD_DIR)/D3DPhongMaterial.obj \
128 $(BUILD_DIR)/D3DPhongShader.obj \
129 $(BUILD_DIR)/D3DPhongShaderGen.obj \
130 $(BUILD_DIR)/Trace.obj
131
132 JAVAH = $(shell cygpath -u $(JDK_HOME)/bin/javah)
133 FXC = $(shell cygpath -u $(DXSDK_PATH)/utilities/bin/$(FXC_ARCH)/fxc)
134
135 LINK = link.exe
136 CC = cl.exe
137
138 LINK_PARAMS = -dll -out:$(PRISM_LIB) -pdb:$(PRISM_PDB) -map:$(PRISM_MAP) -nologo /manifest /opt:REF /incremental:no user32.lib
139 CC_PARAMS += -nologo -Fd$(BUILD_DIR)/ -W3 -DUNICODE -D_UNICODE -DWIN32 -D_LITTLE_ENDIAN -D_STATIC_CPPLIB -I$(BUILD_DIR) -I$(SRC_DIR) -I$(JDK_HOME)/include -I$(JDK_HOME)/include/win32 -I$(DXSDK_PATH)/Include -c
140 ifeq ($(CONF), Release)
141 CC_PARAMS += -Zi -O2 -Oi -MD
142 else
143 LINK_PARAMS += /debug
144 CC_PARAMS += -Zi -Od -DDEBUG -MDd
145 endif
146
147 ifeq ($(NO_PERF_CONT), true)
148 CC_PARAMS += -DNO_PERF_COUNTERS
149 endif
150
151
152 # build
153 build: .build-pre $(PRISM_LIB) .build-post
154
155 $(PRISM_LIB) : $(OBJS)
156 $(LINK) $(LINK_PARAMS) $^
157
158 $(BUILD_DIR)/%.obj : $(SRC_DIR)/%.cc $(JNI_INCLUDES) $(VS_INCLUDE) $(VS_3D_INCLUDE) $(PS_3D_INCLUDE) $(INCLUDES)
159 $(CC) $(CC_PARAMS) -Fo$@ $<
160
161 $(VS_INCLUDE) : $(VS_SRC)
162 $(FXC) /nologo /T vs_3_0 /Fh $(VS_INCLUDE) /E passThrough $(VS_SRC)
163
164 $(PS_3D_INCLUDE) : $(PS_3D_SRC) $(HLSL_3D_INCLUDES)
165 $(FXC) /nologo /T ps_2_0 /Fh $(PS_3D_INCLUDE) /DSpec=0 /DSType=0 $(PS_3D_SRC)
166 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_i.h /DSpec=0 /DSType=0 /DIllumMap=1 $(PS_3D_SRC)
167 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_s1n.h /DSpec=1 /DSType=0 $(PS_3D_SRC)
168 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_s2n.h /DSpec=2 /DSType=0 $(PS_3D_SRC)
169 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_s3n.h /DSpec=3 /DSType=0 $(PS_3D_SRC)
170 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_s1a.h /DSpec=1 /DSType=1 $(PS_3D_SRC)
171 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_s2a.h /DSpec=2 /DSType=1 $(PS_3D_SRC)
172 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_s3a.h /DSpec=3 /DSType=1 $(PS_3D_SRC)
173 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_s1s.h /DSpec=1 /DSType=2 $(PS_3D_SRC)
174 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_s2s.h /DSpec=2 /DSType=2 $(PS_3D_SRC)
175 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_s3s.h /DSpec=3 /DSType=2 $(PS_3D_SRC)
176 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_b1n.h /DSpec=1 /DSType=0 /DBump=1 $(PS_3D_SRC)
177 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_b2n.h /DSpec=2 /DSType=0 /DBump=1 $(PS_3D_SRC)
178 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_b3n.h /DSpec=3 /DSType=0 /DBump=1 $(PS_3D_SRC)
179 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_b1a.h /DSpec=1 /DSType=1 /DBump=1 $(PS_3D_SRC)
180 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_b2a.h /DSpec=2 /DSType=1 /DBump=1 $(PS_3D_SRC)
181 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_b3a.h /DSpec=3 /DSType=1 /DBump=1 $(PS_3D_SRC)
182 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_b1s.h /DSpec=1 /DSType=2 /DBump=1 $(PS_3D_SRC)
183 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_b2s.h /DSpec=2 /DSType=2 /DBump=1 $(PS_3D_SRC)
184 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_b3s.h /DSpec=3 /DSType=2 /DBump=1 $(PS_3D_SRC)
185 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_s1ni.h /DSpec=1 /DSType=0 /DIllumMap=1 $(PS_3D_SRC)
186 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_s2ni.h /DSpec=2 /DSType=0 /DIllumMap=1 $(PS_3D_SRC)
187 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_s3ni.h /DSpec=3 /DSType=0 /DIllumMap=1 $(PS_3D_SRC)
188 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_s1ai.h /DSpec=1 /DSType=1 /DIllumMap=1 $(PS_3D_SRC)
189 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_s2ai.h /DSpec=2 /DSType=1 /DIllumMap=1 $(PS_3D_SRC)
190 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_s3ai.h /DSpec=3 /DSType=1 /DIllumMap=1 $(PS_3D_SRC)
191 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_s1si.h /DSpec=1 /DSType=2 /DIllumMap=1 $(PS_3D_SRC)
192 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_s2si.h /DSpec=2 /DSType=2 /DIllumMap=1 $(PS_3D_SRC)
193 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_s3si.h /DSpec=3 /DSType=2 /DIllumMap=1 $(PS_3D_SRC)
194 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_b1ni.h /DSpec=1 /DSType=0 /DBump=1 /DIllumMap=1 $(PS_3D_SRC)
195 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_b2ni.h /DSpec=2 /DSType=0 /DBump=1 /DIllumMap=1 $(PS_3D_SRC)
196 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_b3ni.h /DSpec=3 /DSType=0 /DBump=1 /DIllumMap=1 $(PS_3D_SRC)
197 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_b1ai.h /DSpec=1 /DSType=1 /DBump=1 /DIllumMap=1 $(PS_3D_SRC)
198 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_b2ai.h /DSpec=2 /DSType=1 /DBump=1 /DIllumMap=1 $(PS_3D_SRC)
199 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_b3ai.h /DSpec=3 /DSType=1 /DBump=1 /DIllumMap=1 $(PS_3D_SRC)
200 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_b1si.h /DSpec=1 /DSType=2 /DBump=1 /DIllumMap=1 $(PS_3D_SRC)
201 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_b2si.h /DSpec=2 /DSType=2 /DBump=1 /DIllumMap=1 $(PS_3D_SRC)
202 $(FXC) /nologo /T ps_2_0 /Fh $(BUILD_HLSL_3D_DIR)/Mtl1PS_b3si.h /DSpec=3 /DSType=2 /DBump=1 /DIllumMap=1 $(PS_3D_SRC)
203
204 $(VS_3D_INCLUDE) : $(VS_3D_SRC) $(HLSL_3D_INCLUDES)
205 $(FXC) /nologo /T vs_2_0 /Fh $(VS_3D_INCLUDE) /DVertexType=ObjVertex $(VS_3D_SRC)
206
207 $(BUILD_DIR)/$(PRISM_JNI_PKG)_%.h : $(PRISM_D3D_CLASS_DIR)/$(PRISM_PKG_PATH)/%.class
208 $(JAVAH) -force -o $@ -jni -classpath "$(PRISM_D3D_CLASS_DIR)\;$(PRISM_DEP_CP)" $(PRISM_PKG).$*
209
210 sanity:
211 @if [ ! -d $(JDK_HOME) ]; then \
212 echo "ERROR: path to Java 6 SDK: $(JDK_HOME) is not found."; \
213 echo "Override the location on the command line"; \
214 echo "using ALT_BOOTDIR variable."; \
215 echo "Sanity check failed."; \
216 exit 1; \
217 fi;
218 @if [ ! -d $(DXSDK_PATH) ]; then \
219 echo "ERROR: path to DirectX 9 SDK: $(DXSDK_PATH) is not found."; \
220 echo "Override the location on the command line"; \
221 echo "using ALT_DXSDK_PATH variable."; \
222 echo "Sanity check failed."; \
223 exit 1; \
224 fi;
225
226 .build-pre: sanity
227 @mkdir -p $(BUILD_DIR) $(BUILD_HLSL_3D_DIR) $(DIST_DIR)
228
229 .build-post:
230
231
232 # clean
233 #clean: .clean-pre .clean-impl .clean-post
234 clean: .clean-pre .clean-post
235 rm -rf $(BUILD_DIR) $(DIST_DIR)
236
237 .clean-pre:
238 # Add your pre 'clean' code here...
239
240 .clean-post:
241 # Add your post 'clean' code here...
242
243
244 # clobber
245 #clobber: .clobber-pre .clobber-impl .clobber-post
246 clobber: .clobber-pre .clobber-post
247 rm -rf $(BUILD_DIR) $(DIST_DIST)
248
249 .clobber-pre:
250
251 .clobber-post:
252 # Add your post 'clobber' code here...
253
254
255 # all
256 #all: .all-pre .all-impl .all-post
257 all: .all-pre build .all-post
258
259 .all-pre:
260 # Add your pre 'all' code here...
261
262 .all-post:
263 # Add your post 'all' code here...
264
265
266 # help
267 help: .help-pre .help-impl .help-post
268
269 .help-pre:
270 # Add your pre 'help' code here...
271
272 .help-post:
273 # Add your post 'help' code here...
274
275 .PRECIOUS: $(JNI_INCLUDES)
276
277 # include project implementation makefile
278 include nbproject/Makefile-impl.mk