From d6aee3887b3eafc224d548eb680dd67a81a48177 Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Sat, 9 Mar 2024 15:20:08 -0600 Subject: [PATCH] remove makefile dependency on tinycdb makefile --- Makefile | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 0c912d9..b4b2e3b 100755 --- a/Makefile +++ b/Makefile @@ -92,6 +92,8 @@ endif CPPFLAGS += -DHAVE_CEIL -DCP_USE_CGTYPES=0 -DCP_USE_DOUBLES=0 -DHAVE_FLOOR -DHAVE_FMOD -DHAVE_LRINT -DHAVE_LRINTF $(includeflag) -MD $(WARNING_FLAGS) -I. -DVER=\"$(VER)\" -DCOM=\"$(COM)\" -DINFO=\"$(INFO)\" #-DENABLE_SINC_MEDIUM_CONVERTER -DENABLE_SINC_FAST_CONVERTER -DCP_COLLISION_TYPE_TYPE=uintptr_t -DCP_BITMASK_TYPE=uintptr_t +CPPFLAGS += -D_FILE_OFFSET_BITS=64 # for tinycdb + # ENABLE_SINC_[BEST|FAST|MEDIUM]_CONVERTER # default, fast and medium available in game at runtime; best available in editor @@ -223,15 +225,15 @@ $(DISTDIR)/$(DIST): $(BIN)/$(NAME) $(BIN)/libengine.a: $(OBJS) @$(AR) rcs $@ $(OBJS) -$(BIN)/libcdb.a: +CDB_C != find $(CDB) -name *.c +CDB_O := $(patsubst %.c, %.o, $(CDB_C)) +$(CDB)/libcdb.a: $(CDB_O) mkdir -p $(BIN) rm -f $(CDB)/libcdb.a - make -C $(CDB) CC=$(CC) AR=$(AR) libcdb.a - cp $(CDB)/libcdb.a $(BIN) - -tools/libcdb.a: - make -C $(CDB) libcdb.a - mv $(CDB)/libcdb.a tools + ar rv $@ $^ + +tools/libcdb.a: $(CDB)/libcdb.a + cp $(CDB)/libcdb.a tools DOCOS = Sound gameobject Game Window physics Profile Time Player Mouse IO Log ColorMap sprite SpriteAnim Render Geometry DOCHTML := $(addsuffix .api.html, $(DOCOS)) @@ -269,7 +271,7 @@ $(OBJDIR)/%.o: %.c source/engine/core.cdb.h $(SHADERS) $(OBJDIR)/%.o: %.cpp @mkdir -p $(@D) - @echo Making C++ object $@ with $(CXX) + @echo Making C++ object $@ @$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ $(OBJDIR)/%.o: %.m @@ -300,7 +302,7 @@ core.cdb: packer $(CORE) chmod 644 out.cdb mv out.cdb core.cdb -CDB_C != find $(CDB) -name *.c + packer: tools/packer.c tools/libcdb.a cc $^ -I$(CDB) -o packer @@ -327,9 +329,9 @@ crossmac: clean: @echo Cleaning project - @rm -rf bin dist - @rm -f shaders/*.sglsl.h shaders/*.metal core.cdb jso cdb packer TAGS - @rm source/engine/core.cdb.h + rm -rf bin dist + rm -f shaders/*.sglsl.h shaders/*.metal core.cdb jso cdb packer TAGS source/engine/core.cdb.h tools/libcdb.a + rm $(CDB)/*.o @make -C quickjs clean docs: doc/prosperon.org