diff options
author | aqua <aqua@iserlohn-fortress.net> | 2023-03-18 07:17:27 +0200 |
---|---|---|
committer | aqua <aqua@iserlohn-fortress.net> | 2023-03-18 07:25:29 +0200 |
commit | 57027fd076504b219f3e886e78535191f6abbb66 (patch) | |
tree | 5166eb58a4ddc86b2865b104f7b7c81529769dab /Makefile | |
download | primes-master.tar.xz |
Sieve of Eratosthenes
- simple implementation and optimized versions
- Segmented sieve with pthreaded version
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 20 |
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 $@ + |