musique/Makefile

31 lines
583 B
Makefile
Raw Normal View History

2022-04-24 15:27:09 +02:00
MAKEFLAGS="-j $(grep -c ^processor /proc/cpuinfo)"
CXXFLAGS=-std=c++20 -Wall -Wextra -O2 -Werror=switch
2022-04-24 16:09:55 +02:00
CPPFLAGS=-Ilib/expected/ -Ilib/ut/ -Isrc/
2022-04-24 15:27:09 +02:00
2022-05-02 15:13:12 +02:00
Obj=bin/errors.o \
bin/lexer.o \
bin/unicode.o
2022-04-24 16:09:55 +02:00
all: bin/musique bin/unit-tests
2022-04-24 15:27:09 +02:00
bin/%.o: src/%.cc src/*.hh
g++ $(CXXFLAGS) $(CPPFLAGS) -o $@ $< -c
2022-04-24 16:09:55 +02:00
bin/musique: $(Obj) bin/main.o src/*.hh
g++ $(CXXFLAGS) $(CPPFLAGS) -o $@ $(Obj) bin/main.o
.PHONY: unit-tests
unit-tests: bin/unit-tests
./$<
bin/unit-tests: src/tests/*.cc $(Obj)
g++ $(CXXFLAGS) $(CPPFLAGS) -o $@ $^
2022-04-24 15:27:09 +02:00
clean:
rm -rf bin
.PHONY: clean
$(shell mkdir -p bin)