Some minor fixes to build process

This commit is contained in:
Stephen Seo 2023-07-30 21:43:18 +09:00
parent 9c6f805697
commit c146d86af7
3 changed files with 10 additions and 6 deletions

View file

@ -12,9 +12,11 @@ OBJDIR = objdir
SOURCES = \ SOURCES = \
src/main.cc src/main.cc
HEADERS =
OBJECTS = $(addprefix ${OBJDIR}/,$(subst .cc,.cc.o,${SOURCES})) OBJECTS = $(addprefix ${OBJDIR}/,$(subst .cc,.cc.o,${SOURCES}))
all: demo_0 all: | format demo_0
demo_0: ${OBJECTS} demo_0: ${OBJECTS}
${CXX} -o demo_0 ${LINKER_FLAGS} $^ ${CXX} -o demo_0 ${LINKER_FLAGS} $^
@ -25,7 +27,8 @@ clean:
rm -rf ${OBJDIR} rm -rf ${OBJDIR}
rm -f demo_0 rm -f demo_0
.SECONDEXPANSION: format:
clang-format -i --style=google ${HEADERS} ${SOURCES}
${OBJDIR}/%.cc.o: %.cc ${OBJDIR}/%.cc.o: %.cc
@mkdir -p $(dir $@) @mkdir -p $(dir $@)

View file

@ -1,8 +1,9 @@
// emscripten includes // emscripten includes
#ifdef __EMSCRIPTEN__ #ifdef __EMSCRIPTEN__
#include "ems.h"
#include <emscripten.h> #include <emscripten.h>
#include <emscripten/html5.h> #include <emscripten/html5.h>
#include "ems.h"
#else #else
#include <random> #include <random>
#endif #endif
@ -22,8 +23,8 @@ EM_BOOL resize_event_callback(int event_type, const EmscriptenUiEvent *event,
//((GameRenderer *)ud)->screen_size_changed(); //((GameRenderer *)ud)->screen_size_changed();
} }
return false; return false;
} // resize_event_callback(...) } // resize_event_callback(...)
} // extern "C" } // extern "C"
#endif #endif
// Main loop frame // Main loop frame

View file

@ -33,4 +33,4 @@ clean:
rm -f jumpartifact.com_demo_0.data rm -f jumpartifact.com_demo_0.data
format: format:
clang-format -i --style=file ${SOURCES} ${HEADERS} clang-format -i --style=google ${SOURCES} ${HEADERS}