summaryrefslogtreecommitdiff
path: root/Makefile
blob: af3901dc16f49415373e9dce4e5d75d994716de1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

CXXFLAGS     += -Wall -Wextra -Wpedantic -g -Og --std=c++20
TESTCXXFLAGS := $(shell pkg-config --cflags gtest gtest_main)
TESTLDFLAGS  := $(shell pkg-config --libs gtest gtest_main) -lpthread

SRCS := sieve_utils.cc sieve.cc segmented_sieve.cc threaded_sieve.cc
OBJS := $(SRCS:.cc=.o)

test: $(OBJS) test.o
	$(CXX) $(TESTLDFLAGS) $^ -o $@

clean:
	rm -f *.o test

%.o: %.cc
	$(CXX) $(CXXFLAGS) -c $^ -o $@

test.o: test.cc
	$(CXX) $(CXXFLAGS) -c $^ -o $@