Last active
January 27, 2017 14:55
-
-
Save keuv-grvl/92f0e22e769dec533a8e69344777cc7c to your computer and use it in GitHub Desktop.
makefile for MaxBin 2.2.1 (with help from @Celforyon)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usage: make -f maxbin.makefile | |
# Config | |
DEBUG := 0 | |
BUILDDIR := build | |
# End config | |
CXX := g++ | |
CXXFLAGS := -MMD -Wall -Wextra -ansi -pedantic -std=c++11 | |
LDFLAGS := -lpthread | |
INC := -I. | |
SOURCES := $(wildcard *.cpp) | |
OBJECTS := $(SOURCES:%.cpp=$(BUILDDIR)/%.o) | |
EXECUTABLE := MaxBin | |
ifneq ($(DEBUG),0) | |
CXXFLAGS += -g -O0 | |
else | |
CXXFLAGS += -O3 | |
endif | |
all: $(EXECUTABLE) | |
$(EXECUTABLE): $(OBJECTS) | |
$(CXX) -o $@ $^ $(LDFLAGS) | |
$(BUILDDIR)/%.o: %.cpp | |
mkdir -p $(BUILDDIR) | |
$(CXX) $(CXXFLAGS) $(INC) -o $@ -c $< | |
clean: | |
rm -r $(BUILDDIR) $(EXECUTABLE) | |
DEPS := $(OBJECTS:.o=.d) | |
-include $(DEPS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment