Move source files to subdirectory
This commit is contained in:
parent
67be4cbf7b
commit
97bc26ce7f
21
Makefile
21
Makefile
|
@ -6,12 +6,23 @@ CXX = g++
|
||||||
CXXFLAGS = -Wall -O2
|
CXXFLAGS = -Wall -O2
|
||||||
# -fsanitize=address -fsanitize=undefined
|
# -fsanitize=address -fsanitize=undefined
|
||||||
|
|
||||||
.PHONY: all
|
SRCDIR = src
|
||||||
all: sortbin recgen
|
BUILDDIR = build
|
||||||
|
|
||||||
sortbin: sortbin.cpp
|
TOOLS = sortbin recgen
|
||||||
recgen: recgen.cpp
|
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
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
$(RM) sortbin recgen
|
$(RM) $(BINFILES)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue