Skip to content

Commit

Permalink
Add heaps in Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiaomao committed Dec 13, 2024
1 parent 9aabf90 commit cf3010f
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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})

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit cf3010f

Please sign in to comment.