blob: 36251680f789df47e19a8716452e5991a07240a6 (
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
34
35
36
|
#
# Mini version of cargo
# - Interprets Cargo.toml files and emits makefiles
# - Supports overriding build script output
#
V ?= @
OBJDIR := .obj/
BIN := ../bin/common_lib.a
OBJS = toml.o path.o debug.o
CXXFLAGS := -Wall -std=c++14 -g -O2
OBJS := $(OBJS:%=$(OBJDIR)%)
.PHONY: all clean
all: $(BIN)
clean:
rm $(BIN) $(OBJS)
$(BIN): $(OBJS)
@mkdir -p $(dir $@)
@echo [AR] rcu $@
$V$(AR) rcu $@ $(OBJS)
$(OBJDIR)%.o: %.cpp
@mkdir -p $(dir $@)
@echo [CXX] $<
$V$(CXX) -o $@ -c $< $(CXXFLAGS) -MMD -MP -MF $@.dep
-include $(OBJS:%.o=%.o.dep)
|