Skip to content

Commit e116f59

Browse files
committed
force rebuild .hpp files
1 parent 753bcce commit e116f59

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

Makefile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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
15431545
examples/deprecation-warning/deprecation-warning.o: examples/deprecation-warning/deprecation-warning.cpp

examples/server/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ foreach(asset ${PUBLIC_ASSETS})
2828
OUTPUT "${output}"
2929
COMMAND "${CMAKE_COMMAND}" "-DINPUT=${input}" "-DOUTPUT=${output}" -P "${PROJECT_SOURCE_DIR}/scripts/xxd.cmake"
3030
)
31+
set_source_files_properties(${output} PROPERTIES GENERATED TRUE)
3132
endforeach()
3233

3334
add_executable(${TARGET} ${TARGET_SRCS})

0 commit comments

Comments
 (0)