diff --git a/Makefile b/Makefile index 20915e30057..b61a5882700 100644 --- a/Makefile +++ b/Makefile @@ -197,18 +197,21 @@ clean: CC_SDL=`sdl2-config --cflags --libs` -main: examples/main/main.cpp ggml.o whisper.o - $(CXX) $(CXXFLAGS) examples/main/main.cpp ggml.o whisper.o -o main $(LDFLAGS) +SRC_COMMON = examples/common.cpp +SRC_COMMON_SDL = examples/common-sdl.cpp + +main: examples/main/main.cpp $(SRC_COMMON) ggml.o whisper.o + $(CXX) $(CXXFLAGS) examples/main/main.cpp $(SRC_COMMON) ggml.o whisper.o -o main $(LDFLAGS) ./main -h -stream: examples/stream/stream.cpp ggml.o whisper.o - $(CXX) $(CXXFLAGS) examples/stream/stream.cpp ggml.o whisper.o -o stream $(CC_SDL) $(LDFLAGS) +stream: examples/stream/stream.cpp $(SRC_COMMON) $(SRC_COMMON_SDL) ggml.o whisper.o + $(CXX) $(CXXFLAGS) examples/stream/stream.cpp $(SRC_COMMON) $(SRC_COMMON_SDL) ggml.o whisper.o -o stream $(CC_SDL) $(LDFLAGS) -command: examples/command/command.cpp ggml.o whisper.o - $(CXX) $(CXXFLAGS) examples/command/command.cpp ggml.o whisper.o -o command $(CC_SDL) $(LDFLAGS) +command: examples/command/command.cpp $(SRC_COMMON) $(SRC_COMMON_SDL) ggml.o whisper.o + $(CXX) $(CXXFLAGS) examples/command/command.cpp $(SRC_COMMON) $(SRC_COMMON_SDL) ggml.o whisper.o -o command $(CC_SDL) $(LDFLAGS) -talk: examples/talk/talk.cpp examples/talk/gpt-2.cpp ggml.o whisper.o - $(CXX) $(CXXFLAGS) examples/talk/talk.cpp examples/talk/gpt-2.cpp ggml.o whisper.o -o talk $(CC_SDL) $(LDFLAGS) +talk: examples/talk/talk.cpp examples/talk/gpt-2.cpp $(SRC_COMMON) $(SRC_COMMON_SDL) ggml.o whisper.o + $(CXX) $(CXXFLAGS) examples/talk/talk.cpp examples/talk/gpt-2.cpp $(SRC_COMMON) $(SRC_COMMON_SDL) ggml.o whisper.o -o talk $(CC_SDL) $(LDFLAGS) bench: examples/bench/bench.cpp ggml.o whisper.o $(CXX) $(CXXFLAGS) examples/bench/bench.cpp ggml.o whisper.o -o bench $(LDFLAGS) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 7f373e7b7ca..f0b6485d860 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -59,5 +59,4 @@ else() add_subdirectory(command) add_subdirectory(bench) add_subdirectory(talk) - add_subdirectory(chess) endif()