From cf3010f21d58fa3ba96ec31b068fb2c0f0e3b385 Mon Sep 17 00:00:00 2001 From: Yuxiao Mao Date: Fri, 13 Dec 2024 11:30:38 +0100 Subject: [PATCH] Add heaps in Makefile --- Makefile | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3b93bda3c..ca5cd32a4 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ INSTALL_BIN_DIR ?= $(PREFIX)/bin INSTALL_LIB_DIR ?= $(PREFIX)/lib INSTALL_INCLUDE_DIR ?= $(PREFIX)/include -LIBS=fmt sdl ssl openal ui uv mysql sqlite +LIBS=fmt sdl ssl openal ui uv mysql sqlite heaps ARCH ?= $(shell uname -m) CFLAGS = -Wall -O3 -I src -std=c11 -D LIBHL_EXPORTS @@ -105,6 +105,18 @@ MYSQL = libs/mysql/socket.o libs/mysql/sha1.o libs/mysql/my_proto.o libs/mysql/m SQLITE = libs/sqlite/sqlite.o +HEAPS = libs/heaps/mikkt.o libs/heaps/meshoptimizer.o libs/heaps/vhacd.o +HEAPS += include/mikktspace/mikktspace.o +HEAPS += include/meshoptimizer/allocator.o include/meshoptimizer/overdrawoptimizer.o \ + include/meshoptimizer/vcacheoptimizer.o include/meshoptimizer/clusterizer.o \ + include/meshoptimizer/quantization.o include/meshoptimizer/vertexcodec.o \ + include/meshoptimizer/indexcodec.o include/meshoptimizer/simplifier.o \ + include/meshoptimizer/vertexfilter.o include/meshoptimizer/indexgenerator.o \ + include/meshoptimizer/spatialorder.o include/meshoptimizer/vfetchanalyzer.o \ + include/meshoptimizer/stripifier.o include/meshoptimizer/vfetchoptimizer.o \ + include/meshoptimizer/overdrawanalyzer.o include/meshoptimizer/vcacheanalyzer.o +HEAPS_CFLAGS = -I include/mikktspace -I include/meshoptimizer -I include/vhacd + LIB = ${PCRE} ${RUNTIME} ${STD} BOOT = src/_main.o @@ -290,6 +302,21 @@ mysql: ${MYSQL} libhl sqlite: ${SQLITE} libhl ${CC} ${CFLAGS} -shared -o sqlite.hdll ${SQLITE} ${LIBFLAGS} -L. -lhl -lsqlite3 +./include/mikktspace/%.o: ./include/mikktspace/%.c + ${CC} ${CFLAGS} -o $@ -c $< ${HEAPS_CFLAGS} + +./include/meshoptimizer/%.o: ./include/meshoptimizer/%.cpp + ${CC} ${CFLAGS} -o $@ -c $< ${HEAPS_CFLAGS} + +./libs/heaps/%.o: ./libs/heaps/%.c + ${CC} ${CFLAGS} -o $@ -c $< ${HEAPS_CFLAGS} + +./libs/heaps/%.o: ./libs/heaps/%.cpp + ${CC} ${CFLAGS} -o $@ -c $< ${HEAPS_CFLAGS} + +heaps: ${HEAPS} libhl + ${CC} ${CFLAGS} ${HEAPS_CFLAGS} -shared -o heaps.hdll ${HEAPS} ${LIBFLAGS} -L. -lhl + mesa: (cd libs/mesa && ${MAKE}) @@ -363,7 +390,7 @@ codesign_osx: ${CC} ${CFLAGS} -o $@ -c $< clean_o: - rm -f ${STD} ${BOOT} ${RUNTIME} ${PCRE} ${HL} ${FMT} ${SDL} ${SSL} ${OPENAL} ${UI} ${UV} ${MYSQL} ${SQLITE} ${HL_DEBUG} + rm -f ${STD} ${BOOT} ${RUNTIME} ${PCRE} ${HL} ${FMT} ${SDL} ${SSL} ${OPENAL} ${UI} ${UV} ${MYSQL} ${SQLITE} ${HEAPS} ${HL_DEBUG} clean: clean_o rm -f hl hl.exe libhl.$(LIBEXT) *.hdll