1
0
Fork 0

Move source files to subdirectory

This commit is contained in:
Joris van Rantwijk 2022-06-25 13:57:12 +02:00
parent 67be4cbf7b
commit 97bc26ce7f
3 changed files with 16 additions and 5 deletions

View File

@ -6,12 +6,23 @@ CXX = g++
CXXFLAGS = -Wall -O2
# -fsanitize=address -fsanitize=undefined
.PHONY: all
all: sortbin recgen
SRCDIR = src
BUILDDIR = build
sortbin: sortbin.cpp
recgen: recgen.cpp
TOOLS = sortbin recgen
BINFILES = $(patsubst %,$(BUILDDIR)/%,$(TOOLS))
.PHONY: all
all: $(BINFILES)
$(BUILDDIR)/sortbin: $(SRCDIR)/sortbin.cpp
$(BUILDDIR)/recgen: $(SRCDIR)/recgen.cpp
$(BUILDDIR)/%: $(SRCDIR)/%.cpp
@mkdir -p $(BUILDDIR)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $< $(LDLIBS) -o $@
.PHONY: clean
clean:
$(RM) sortbin recgen
$(RM) $(BINFILES)