summaryrefslogtreecommitdiff
path: root/Makefile
blob: 635839436ae4a7189a990734fa937709be038e3c (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
all: libcppbuild.a cppbuild

SRC = \
	libcppbuild.cc \
	task_cc.cc \
	task_ld.cc \
	task_ar.cc \
	task_so.cc \
	task.cc \
	execute.cc \
	configure.cc \
	rebuild.cc \
	tasks.cc \
	build.cc \

OBJ = $(patsubst %.cc,%.o,$(SRC))

DEPFILES := $(patsubst %.cc,%.d,$(SRC))
$(DEPFILES):

include $(wildcard $(DEPFILES))

CXXFLAGS = -Wall -g -O3 -std=c++17 -I.

%.o: %.cc
	g++ -MMD $(CXXFLAGS) -c $< -o $@

libcppbuild.a: $(OBJ)
	ar rcs $@ $(OBJ)

cppbuild: libcppbuild.a
	g++ $(CXXFLAGS) -pthread libcppbuild.a -o $@

clean:
	rm -f libcppbuild.a $(OBJ) cppbuild $(DEPFILES)