1
0
Fork 0
sortbin/Makefile

42 lines
986 B
Makefile
Raw Permalink Normal View History

2022-06-21 07:50:19 +02:00
#
# Makefile for sortbin utility.
#
CXX = g++
CXXFLAGS = -Wall -O2 -pthread
2022-07-03 14:55:00 +02:00
CXXFLAGS_DEBUG = -g -fsanitize=address -fsanitize=undefined -fsanitize=leak
2022-06-21 07:50:19 +02:00
2022-06-25 13:57:12 +02:00
SRCDIR = src
BUILDDIR = build
TOOLS = sortbin recgen
BINFILES = $(patsubst %,$(BUILDDIR)/%,$(TOOLS))
2022-07-03 14:55:00 +02:00
BINFILES_DEBUG = $(patsubst %,$(BUILDDIR)/%_dbg,$(TOOLS))
2022-06-25 13:57:12 +02:00
2022-06-24 15:16:22 +02:00
.PHONY: all
2022-06-25 13:57:12 +02:00
all: $(BINFILES)
2022-06-24 15:16:22 +02:00
2022-07-03 14:55:00 +02:00
.PHONY: test
test: $(BINFILES_DEBUG)
cd tests ; ./run_tests.sh
2022-06-25 13:57:12 +02:00
$(BUILDDIR)/sortbin: $(SRCDIR)/sortbin.cpp
2022-07-03 17:02:51 +02:00
$(BUILDDIR)/recgen: $(SRCDIR)/recgen.cpp $(SRCDIR)/xoroshiro128plus.h
$(BUILDDIR)/sortbin_dbg: $(SRCDIR)/sortbin.cpp
$(BUILDDIR)/recgen_dbg: $(SRCDIR)/recgen.cpp $(SRCDIR)/xoroshiro128plus.h
2022-06-25 13:57:12 +02:00
$(BUILDDIR)/%: $(SRCDIR)/%.cpp
@mkdir -p $(BUILDDIR)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $< $(LDLIBS) -o $@
2022-06-21 07:50:19 +02:00
2022-07-03 14:55:00 +02:00
$(BUILDDIR)/%_dbg: $(SRCDIR)/%.cpp
@mkdir -p $(BUILDDIR)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CXXFLAGS_DEBUG) $(LDFLAGS) $< $(LDLIBS) -o $@
2022-06-21 07:50:19 +02:00
.PHONY: clean
clean:
2022-07-03 14:55:00 +02:00
$(RM) $(BINFILES) $(BINFILES_DEBUG)
$(RM) -r tests/testdata
2022-06-25 13:57:12 +02:00