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

SRC = \
	libcppbuild.cc \
	task_cc.cc \
	task_ld.cc \
	task_ar.cc \
	task_so.cc \
	task.cc \
	execute.cc \

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

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

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

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

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

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