diff options
Diffstat (limited to 'src/Makefile')
-rw-r--r-- | src/Makefile | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/src/Makefile b/src/Makefile index 666a07ad..96039ba0 100644 --- a/src/Makefile +++ b/src/Makefile | |||
@@ -134,10 +134,10 @@ TARGET_ARCH= $(patsubst %,-DLUAJIT_TARGET=LUAJIT_ARCH_%,$(TARGET)) | |||
134 | 134 | ||
135 | HOST_CC= $(CC) | 135 | HOST_CC= $(CC) |
136 | HOST_RM= rm -f | 136 | HOST_RM= rm -f |
137 | # NOTE: The LuaJIT distribution comes with a pre-generated buildvm_*.h. | 137 | # NOTE: The LuaJIT distribution comes with pre-generated buildvm_*.h files. |
138 | # You DO NOT NEED an installed copy of (plain) Lua 5.1 to run DynASM unless | 138 | # You DO NOT NEED an installed copy of (plain) Lua 5.1 to run DynASM unless |
139 | # you want to MODIFY the corresponding *.dasc file. You can also use LuaJIT | 139 | # you want to MODIFY the corresponding *.dasc file. You can also use LuaJIT |
140 | # itself (bootstrapped from the pre-generated file) to run DynASM of course. | 140 | # itself (bootstrapped from a pre-generated file) to run DynASM of course. |
141 | HOST_LUA= lua | 141 | HOST_LUA= lua |
142 | 142 | ||
143 | HOST_XCFLAGS= | 143 | HOST_XCFLAGS= |
@@ -237,6 +237,9 @@ DASM_DIR= ../dynasm | |||
237 | DASM= $(HOST_LUA) $(DASM_DIR)/dynasm.lua | 237 | DASM= $(HOST_LUA) $(DASM_DIR)/dynasm.lua |
238 | DASM_FLAGS= | 238 | DASM_FLAGS= |
239 | DASM_DISTFLAGS= -LN | 239 | DASM_DISTFLAGS= -LN |
240 | DASM_FLAGS_X86= | ||
241 | DASM_FLAGS_X64= -D X64 | ||
242 | DASM_FLAGS_X64WIN= -D X64 -D X64WIN | ||
240 | 243 | ||
241 | BUILDVM_O= buildvm.o buildvm_asm.o buildvm_peobj.o buildvm_lib.o buildvm_fold.o | 244 | BUILDVM_O= buildvm.o buildvm_asm.o buildvm_peobj.o buildvm_lib.o buildvm_fold.o |
242 | BUILDVM_T= buildvm | 245 | BUILDVM_T= buildvm |
@@ -277,7 +280,7 @@ LUAJIT_T= luajit | |||
277 | 280 | ||
278 | ALL_T= $(LUAJIT_T) $(LUAJIT_A) $(LUAJIT_SO) $(BUILDVM_T) | 281 | ALL_T= $(LUAJIT_T) $(LUAJIT_A) $(LUAJIT_SO) $(BUILDVM_T) |
279 | ALL_GEN= $(LJVM_S) lj_ffdef.h lj_libdef.h lj_recdef.h $(LIB_VMDEFP) lj_folddef.h | 282 | ALL_GEN= $(LJVM_S) lj_ffdef.h lj_libdef.h lj_recdef.h $(LIB_VMDEFP) lj_folddef.h |
280 | ALL_DYNGEN= buildvm_x86.h | 283 | ALL_DYNGEN= buildvm_*.h |
281 | WIN_RM= *.obj *.lib *.exp *.dll *.exe *.manifest *.pdb *.ilk | 284 | WIN_RM= *.obj *.lib *.exp *.dll *.exe *.manifest *.pdb *.ilk |
282 | ALL_RM= $(ALL_T) $(ALL_GEN) *.o $(WIN_RM) | 285 | ALL_RM= $(ALL_T) $(ALL_GEN) *.o $(WIN_RM) |
283 | 286 | ||
@@ -358,7 +361,9 @@ cleaner: | |||
358 | 361 | ||
359 | distclean: clean | 362 | distclean: clean |
360 | $(E) "DYNASM $@" | 363 | $(E) "DYNASM $@" |
361 | $(Q)$(DASM) $(DASM_DISTFLAGS) -o buildvm_x86.h buildvm_x86.dasc | 364 | $(Q)$(DASM) $(DASM_DISTFLAGS) $(DASM_FLAGS_X86) -o buildvm_x86.h buildvm_x86.dasc |
365 | $(Q)$(DASM) $(DASM_DISTFLAGS) $(DASM_FLAGS_X64) -o buildvm_x64.h buildvm_x86.dasc | ||
366 | $(Q)$(DASM) $(DASM_DISTFLAGS) $(DASM_FLAGS_X64WIN) -o buildvm_x64win.h buildvm_x86.dasc | ||
362 | 367 | ||
363 | depend: | 368 | depend: |
364 | @test -f lj_ffdef.h || touch lj_ffdef.h | 369 | @test -f lj_ffdef.h || touch lj_ffdef.h |
@@ -366,12 +371,16 @@ depend: | |||
366 | @test -f lj_recdef.h || touch lj_recdef.h | 371 | @test -f lj_recdef.h || touch lj_recdef.h |
367 | @test -f lj_folddef.h || touch lj_folddef.h | 372 | @test -f lj_folddef.h || touch lj_folddef.h |
368 | @test -f buildvm_x86.h || touch buildvm_x86.h | 373 | @test -f buildvm_x86.h || touch buildvm_x86.h |
374 | @test -f buildvm_x64.h || touch buildvm_x64.h | ||
375 | @test -f buildvm_x64win.h || touch buildvm_x64win.h | ||
369 | @$(HOST_CC) $(HOST_ACFLAGS) -MM *.c | sed "s|$(DASM_DIR)|\$$(DASM_DIR)|g" >Makefile.dep | 376 | @$(HOST_CC) $(HOST_ACFLAGS) -MM *.c | sed "s|$(DASM_DIR)|\$$(DASM_DIR)|g" >Makefile.dep |
370 | @test -s lj_ffdef.h || $(HOST_RM) lj_ffdef.h | 377 | @test -s lj_ffdef.h || $(HOST_RM) lj_ffdef.h |
371 | @test -s lj_libdef.h || $(HOST_RM) lj_libdef.h | 378 | @test -s lj_libdef.h || $(HOST_RM) lj_libdef.h |
372 | @test -s lj_recdef.h || $(HOST_RM) lj_recdef.h | 379 | @test -s lj_recdef.h || $(HOST_RM) lj_recdef.h |
373 | @test -s lj_folddef.h || $(HOST_RM) lj_folddef.h | 380 | @test -s lj_folddef.h || $(HOST_RM) lj_folddef.h |
374 | @test -s buildvm_x86.h || $(HOST_RM) buildvm_x86.h | 381 | @test -s buildvm_x86.h || $(HOST_RM) buildvm_x86.h |
382 | @test -s buildvm_x64.h || $(HOST_RM) buildvm_x64.h | ||
383 | @test -s buildvm_x64win.h || $(HOST_RM) buildvm_x64win.h | ||
375 | 384 | ||
376 | .PHONY: default all amalg clean cleaner distclean depend | 385 | .PHONY: default all amalg clean cleaner distclean depend |
377 | 386 | ||
@@ -381,7 +390,17 @@ depend: | |||
381 | 390 | ||
382 | buildvm_x86.h: buildvm_x86.dasc | 391 | buildvm_x86.h: buildvm_x86.dasc |
383 | $(E) "DYNASM $@" | 392 | $(E) "DYNASM $@" |
384 | $(Q)$(DASM) $(DASM_FLAGS) -o $@ buildvm_x86.dasc | 393 | $(Q)$(DASM) $(DASM_FLAGS) $(DASM_FLAGS_X86) -o $@ buildvm_x86.dasc |
394 | |||
395 | buildvm_x64.h: buildvm_x86.dasc | ||
396 | $(E) "DYNASM $@" | ||
397 | $(Q)$(DASM) $(DASM_FLAGS) $(DASM_FLAGS_X64) -o $@ buildvm_x86.dasc | ||
398 | |||
399 | buildvm_x64win.h: buildvm_x86.dasc | ||
400 | $(E) "DYNASM $@" | ||
401 | $(Q)$(DASM) $(DASM_FLAGS) $(DASM_FLAGS_X64WIN) -o $@ buildvm_x86.dasc | ||
402 | |||
403 | buildvm.o: buildvm_x86.h buildvm_x64.h buildvm_x64win.h | ||
385 | 404 | ||
386 | $(BUILDVM_T): $(BUILDVM_O) | 405 | $(BUILDVM_T): $(BUILDVM_O) |
387 | $(E) "HOSTLINK $@" | 406 | $(E) "HOSTLINK $@" |