Skip to content

Commit cb91035

Browse files
mpoulletFleker
authored andcommitted
Small Makefile cleanup. (#33)
- add target run_assistant to the phony targets - put source files together in _SRCS groups - add missing run_assistant_file.o to ASSISTANT_O target - do not link with libcurl
1 parent 8582e31 commit cb91035

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

Makefile

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ CXXFLAGS += -std=c++11 $(GRPC_GRPCPP_CFLAGS)
6161
ifeq ($(SYSTEM),Darwin)
6262
LDFLAGS += $(GRPC_GRPCPP_LDLAGS) \
6363
-lgrpc++_reflection -lgrpc_cronet \
64-
-lprotobuf -lpthread -ldl -lcurl
64+
-lprotobuf -lpthread -ldl
6565
else
6666
LDFLAGS += $(GRPC_GRPCPP_LDLAGS) \
6767
-lgrpc_cronet -Wl,--no-as-needed -lgrpc++_reflection \
68-
-Wl,--as-needed -lprotobuf -lpthread -ldl -lcurl
68+
-Wl,--as-needed -lprotobuf -lpthread -ldl
6969
endif
7070

7171
AUDIO_SRCS =
@@ -75,20 +75,36 @@ CXXFLAGS += $(ALSA_CFLAGS)
7575
LDFLAGS += $(ALSA_LDFLAGS)
7676
endif
7777

78-
ASSISTANT_O = $(AUDIO_SRCS:.cc=.o) ./src/audio_input_file.o ./src/base64_encode.o ./src/json_util.o \
79-
./src/run_assistant_audio.o ./src/run_assistant_text.o
80-
ASSISTANT_AUDIO_O = $(AUDIO_SRCS:.cc=.o) ./src/audio_input_file.o ./src/base64_encode.o ./src/json_util.o \
81-
./src/run_assistant_audio.o
82-
ASSISTANT_FILE_O = $(AUDIO_SRCS:.cc=.o) ./src/audio_input_file.o ./src/base64_encode.o ./src/json_util.o \
83-
./src/run_assistant_file.o
84-
ASSISTANT_TEXT_O = ./src/json_util.o ./src/base64_encode.o ./src/run_assistant_text.o
78+
CORE_SRCS = ./src/base64_encode.cc ./src/json_util.cc
79+
AUDIO_INPUT_FILE_SRCS = ./src/audio_input_file.cc
80+
ASSISTANT_AUDIO_SRCS = ./src/run_assistant_audio.cc
81+
ASSISTANT_FILE_SRCS = ./src/run_assistant_file.cc
82+
ASSISTANT_TEXT_SRCS = ./src/run_assistant_text.cc
83+
84+
ASSISTANT_O = $(CORE_SRCS:.cc=.o) \
85+
$(AUDIO_SRCS:.cc=.o) \
86+
$(AUDIO_INPUT_FILE_SRCS:.cc=.o) \
87+
$(ASSISTANT_AUDIO_SRCS:.cc=.o) \
88+
$(ASSISTANT_FILE_SRCS:.cc=.o) \
89+
$(ASSISTANT_TEXT_SRCS:.cc=.o)
90+
ASSISTANT_AUDIO_O = $(CORE_SRCS:.cc=.o) \
91+
$(AUDIO_SRCS:.cc=.o) \
92+
$(AUDIO_INPUT_FILE_SRCS:.cc=.o) \
93+
$(ASSISTANT_AUDIO_SRCS:.cc=.o)
94+
ASSISTANT_FILE_O = $(CORE_SRCS:.cc=.o) \
95+
$(AUDIO_SRCS:.cc=.o) \
96+
$(AUDIO_INPUT_FILE_SRCS:.cc=.o) \
97+
$(ASSISTANT_FILE_SRCS:.cc=.o)
98+
ASSISTANT_TEXT_O = $(CORE_SRCS:.cc=.o) \
99+
$(ASSISTANT_TEXT_SRCS:.cc=.o)
85100

86101
.PHONY: all
87102
all: run_assistant
88103

89104
googleapis.ar: $(GOOGLEAPIS_CCS:.cc=.o)
90105
$(AR) r $@ $?
91106

107+
.PHONY: run_assistant
92108
run_assistant: run_assistant_audio run_assistant_file run_assistant_text
93109

94110
run_assistant_audio: $(GOOGLEAPIS_ASSISTANT_CCS:.cc=.o) googleapis.ar \

0 commit comments

Comments
 (0)