summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/makefile
blob: 6e030818747ffc436ef87b36dff1564314af9e07 (plain)
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
26
27
28
29
30
31
32
33
# Please support Karl working on this intelligence framework.  The framework needs to be quality, so that the rest may function.

CXXFLAGS=-pedantic -Wall -Werror -Wno-error=deprecated-declarations -Wno-gnu-zero-variadic-macro-arguments -std=gnu++17 -fno-operator-names -ggdb -O0
LINK.o=$(LINK.cc)

all: level0 level1 habit-starts/rhythm level2
level0: level0.o liblevel0.a
liblevel0.a: $(patsubst %.cpp,%.o,$(wildcard level-0/*.cpp))
level1: level1.o liblevel1.a
liblevel1.a: $(patsubst %.cpp,%.o,$(wildcard level-0/*.cpp)) $(patsubst %.cpp,%.o,$(wildcard level-1/*.cpp))
level2: level2.o liblevel2.a
liblevel2.a: $(patsubst %.cpp,%.o,$(wildcard level-0/*.cpp)) $(patsubst %.cpp,%.o,$(wildcard level-1/*.cpp)) $(patsubst %.cpp,%.o,$(wildcard level-2/*.cpp))

habit-starts/rhythm: habit-starts/rhythm.o liblevel2.a

-include $(patsubst %.cpp,%.d,$(wildcard level-0/*.cpp) $(wildcard level-1/*.cpp) $(wildcrd level-2/*.cpp) $(wildcard level*.cpp))

%.o: %.ii
	$(CXX) $(CXXFLAGS) -c $*.ii -o $*.o
%.ii %.d: %.cpp
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -MMD -MQ $*.ii -E $*.cpp -o $*.ii
.INTERMEDIATE: $(patsubst %.cpp,%.ii,$(wildcard */*.cpp) $(wildcard *.cpp))

level-0/%.ii: $(wildcard level-0/*.hpp)
level-1/%.ii: $(wildcard level-0/*.hpp) $(wildcard level-1/*.hpp)
level-2/%.ii: $(wildcard level-0/*.hpp) $(wildcard level-1/*.hpp) $(wildcard level-2/*.hpp)

%.a:
	ar cr $@ $^
	ranlib $@

clean:
	-rm *.ii *.o level? *.a */*.o */*.ii *.d */*.d