-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
25 lines (18 loc) · 761 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
CRYSTAL ?= crystal
SFML_INCLUDE_DIR ?= /usr/include
shellquote = '$(subst ','"'"',$1)'
modules := system window graphics audio network
crystal_files := $(foreach module,$(modules),src/$(module)/obj.cr src/$(module)/lib.cr) src/version.cr
cpp_files := $(foreach module,$(modules),src/$(module)/ext.cpp)
obj_files := $(cpp_files:.cpp=.o)
.PHONY: all
all: $(crystal_files) $(obj_files)
.INTERMEDIATE: sources
$(crystal_files) $(cpp_files): sources ;
sources: generate.cr shard.yml $(foreach module,$(modules),docs/api/$(module).md)
$(CRYSTAL) run generate.cr -- $(call shellquote,$(SFML_INCLUDE_DIR))
%.o: %.cpp
$(CXX) -Wno-deprecated-declarations -I $(call shellquote,$(SFML_INCLUDE_DIR)) $(CXXFLAGS) -o $@ -c $<
.PHONY: clean
clean:
rm -f $(obj_files)