summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2023-03-18 07:17:27 +0200
committeraqua <aqua@iserlohn-fortress.net>2023-03-18 07:25:29 +0200
commit57027fd076504b219f3e886e78535191f6abbb66 (patch)
tree5166eb58a4ddc86b2865b104f7b7c81529769dab /Makefile
downloadprimes-master.tar.xz
Initial commitHEADmaster
Sieve of Eratosthenes - simple implementation and optimized versions - Segmented sieve with pthreaded version
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 20 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..af3901d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,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 $@
+