Skip to content

Commit

Permalink
Merge branch 'master' into handle
Browse files Browse the repository at this point in the history
  • Loading branch information
Unreal-Dan committed Dec 14, 2023
2 parents 1af1f96 + 62dad32 commit 4c5a926
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
10 changes: 8 additions & 2 deletions VortexEngine/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ RANLIB=ranlib

# target files
TARGETS=\
vortex \
vortex.a
vortex

.PHONY: $(TARGETS)

Expand All @@ -21,6 +20,10 @@ all: $(TARGETS)
# unit test target
tests: $(TESTS)

# force sub-build of wasm
wasm: FORCE
env WASM=1 $(MAKE)

vortex.a:
$(MAKE) -C VortexLib
cp -f VortexLib/vortex.a .
Expand All @@ -29,6 +32,9 @@ vortex:
$(MAKE) -C VortexCLI
cp -f VortexCLI/vortex .

# emptry rule forces stuff to re reun every time
FORCE:

# generic clean target
clean:
@$(RM) $(TARGETS) $(TESTS) vortex.exe
Expand Down
3 changes: 2 additions & 1 deletion VortexEngine/VortexCLI/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ INCLUDES=\

ifdef WASM
DEFINES += -D WASM
CFLAGS += -s DISABLE_EXCEPTION_CATCHING=0 --bind
endif

ifdef TESTFRAMEWORK
Expand Down Expand Up @@ -125,7 +126,7 @@ FORCE:

# generic clean target
clean:
@$(RM) $(DFILES) $(OBJS) $(TARGETS) $(TESTS) *.txt FlashStorage.flash
@$(RM) $(DFILES) $(OBJS) $(TARGETS) $(TESTS) vortex.wasm *.txt FlashStorage.flash
$(MAKE) -C ../VortexLib clean

# Now include our target dependency files
Expand Down
2 changes: 1 addition & 1 deletion VortexEngine/VortexCLI/VortexCLI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ static void wasm_init()
emscripten_set_keyup_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, 0, 1, key_callback);
emscripten_set_main_loop(do_run, 0, true);
// turn colored output off in the wasm version
g_pVortexCLI->setColoredOuptut(false);
//g_pVortexCLI->setColoredOuptut(false);
}
#endif // ifdef WASM

Expand Down
14 changes: 11 additions & 3 deletions VortexEngine/VortexLib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ INCLUDES=\

ifdef WASM
DEFINES += -D WASM
CFLAGS += --bind -s MODULARIZE=1 -s EXPORT_ES6=1 -s EXPORT_NAME='VortexLib'
endif

ifdef TESTFRAMEWORK
Expand Down Expand Up @@ -91,8 +92,12 @@ DEPS=\
TESTS=\

# target files
TARGETS=\
vortex.a \
ifdef WASM
TARGETS=VortexLib.js \
vortex.a
else
TARGETS=vortex.a
endif

# Default target for 'make' command
all: $(TARGETS)
Expand All @@ -108,6 +113,9 @@ wasm: FORCE
vortex.a: $(DEPS)
$(AR) $@ $^

VortexLib.js: $(DEPS)
$(CC) $(CFLAGS) $^ -o $@ $(LLIBS)

# catch-all make target to generate .o and .d files
%.o: %.cpp
$(CC) $(CFLAGS) -MMD -c $< -o $@
Expand All @@ -124,7 +132,7 @@ FORCE:

# generic clean target
clean:
@$(RM) $(DFILES) $(OBJS) $(TARGETS) $(TESTS)
@$(RM) $(DFILES) $(OBJS) $(TARGETS) $(TESTS) VortexLib.js vortex.wasm

# Now include our target dependency files
# the hyphen means ignore non-existent files
Expand Down

0 comments on commit 4c5a926

Please sign in to comment.