musique/scripts/build.mk

31 lines
1.2 KiB
Makefile
Raw Normal View History

2022-10-14 16:43:13 +02:00
Release_Obj=$(addprefix bin/$(os)/,$(Obj))
2022-12-05 22:34:40 +01:00
Server=bin/$(os)/server/server.h bin/$(os)/server/server.o
$(Server) &: server/*.go server/**/*.go
2022-12-14 17:42:54 +01:00
cd server/; GOOS="$(GOOS)" GOARCH="$(GOARCH)" CGO_ENABLED=1 CC="$(CC)" \
go build -o ../bin/$(os)/server/server.o -buildmode=c-archive
2022-12-05 22:34:40 +01:00
2022-10-14 16:43:13 +02:00
bin/$(os)/bestline.o: lib/bestline/bestline.c lib/bestline/bestline.h
@echo "CC $@"
@$(CC) $< -c -O3 -o $@
2022-12-05 22:34:40 +01:00
bin/$(os)/%.o: musique/%.cc $(Server)
2022-10-14 16:43:13 +02:00
@echo "CXX $@"
@$(CXX) $(CXXFLAGS) $(RELEASE_FLAGS) $(CPPFLAGS) -o $@ $< -c
2022-12-05 22:34:40 +01:00
bin/$(os)/$(Target): $(Release_Obj) bin/$(os)/main.o bin/$(os)/rtmidi.o $(Bestline) $(Server)
2022-10-14 16:43:13 +02:00
@echo "CXX $@"
2022-12-05 22:34:40 +01:00
@$(CXX) $(CXXFLAGS) $(RELEASE_FLAGS) $(CPPFLAGS) -o $@ $(Release_Obj) bin/$(os)/rtmidi.o $(Bestline) $(LDFLAGS) $(LDLIBS) bin/$(os)/server/server.o
2022-10-14 16:43:13 +02:00
Debug_Obj=$(addprefix bin/$(os)/debug/,$(Obj))
bin/$(os)/debug/$(Target): $(Debug_Obj) bin/$(os)/debug/main.o bin/$(os)/rtmidi.o $(Bestline) $(Server)
2022-10-14 16:43:13 +02:00
@echo "CXX $@"
@$(CXX) $(CXXFLAGS) $(DEBUG_FLAGS) $(CPPFLAGS) -o $@ $(Debug_Obj) bin/$(os)/rtmidi.o $(Bestline) $(LDFLAGS) $(LDLIBS) bin/$(os)/server/server.o
2022-10-14 16:43:13 +02:00
bin/$(os)/debug/%.o: musique/%.cc
@echo "CXX $@"
@$(CXX) $(CXXFLAGS) $(DEBUG_FLAGS) $(CPPFLAGS) -o $@ $< -c