@@ -1141,16 +1141,19 @@ $(LIB_COMMON_S): $(OBJ_COMMON)
11411141# Include dependency files
11421142-include $(DEP_FILES )
11431143
1144+ # Clean generated server assets
1145+ clean-server-assets :
1146+ find examples/server -type f -name " *.js.hpp" -delete
1147+ find examples/server -type f -name " *.mjs.hpp" -delete
1148+ find examples/server -type f -name " *.css.hpp" -delete
1149+ find examples/server -type f -name " *.html.hpp" -delete
1150+
11441151# Clean rule
1145- clean :
1152+ clean : clean-server-assets
11461153 rm -vrf $(BUILD_TARGETS ) $(TEST_TARGETS )
11471154 rm -rvf * .a * .dll * .so * .dot
11481155 find ggml src common tests examples pocs -type f -name " *.o" -delete
11491156 find ggml src common tests examples pocs -type f -name " *.d" -delete
1150- find examples/server -type f -name " *.js.hpp" -delete
1151- find examples/server -type f -name " *.mjs.hpp" -delete
1152- find examples/server -type f -name " *.css.hpp" -delete
1153- find examples/server -type f -name " *.html.hpp" -delete
11541157
11551158#
11561159# Examples
@@ -1356,13 +1359,12 @@ llama-server: \
13561359 examples/server/index.html.hpp \
13571360 examples/server/loading.html.hpp \
13581361 common/json.hpp \
1359- common/stb_image.h \
13601362 $(OBJ_ALL )
13611363 $(CXX ) $(CXXFLAGS ) -c $< -o $(call GET_OBJ_FILE, $< )
13621364 $(CXX ) $(CXXFLAGS ) $(filter-out % .h % .hpp $< ,$^ ) -Iexamples/server $(call GET_OBJ_FILE, $< ) -o $@ $(LDFLAGS ) $(LWINSOCK2 )
13631365
13641366# Portable equivalent of `cd examples/server/public && xxd -i $(notdir $<) ../$(notdir $<).hpp`:
1365- examples/server/% .hpp : examples/server/public/% Makefile
1367+ examples/server/% .hpp : examples/server/public/% FORCE Makefile
13661368 @ ( export NAME=$( subst .,_,$( subst -,_,$( notdir $< ) ) ) && \
13671369 echo " unsigned char $$ {NAME}[] = {" && \
13681370 cat $< | od -v -t x1 -An | sed -E ' s/([0-9a-fA-F]+)/0x\1, /g' && \
@@ -1537,7 +1539,7 @@ llama-q8dot: pocs/vdot/q8dot.cpp ggml/src/ggml.o \
15371539# Deprecated binaries that we want to keep around long enough for people to migrate to the new filenames, then these can be removed.
15381540#
15391541# Mark legacy binary targets as .PHONY so that they are always checked.
1540- .PHONY : main quantize perplexity embedding server
1542+ .PHONY : FORCE main quantize perplexity embedding server
15411543
15421544# Define the object file target
15431545examples/deprecation-warning/deprecation-warning.o : examples/deprecation-warning/deprecation-warning.cpp
0 commit comments