makefile based build
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
# Compiler
|
||||
CXX := g++
|
||||
|
||||
# Common settings
|
||||
STD := -std=c++14
|
||||
TARGET := floating_demo
|
||||
SRC := main.cpp
|
||||
|
||||
# Debug flags
|
||||
CXXFLAGS_DEBUG := $(STD) -O0 -Wall -Wextra -pedantic
|
||||
|
||||
# Release flags
|
||||
CXXFLAGS_RELEASE := $(STD) -O2
|
||||
|
||||
# Default target
|
||||
all: debug
|
||||
|
||||
# Debug build
|
||||
debug:
|
||||
$(CXX) $(CXXFLAGS_DEBUG) $(SRC) -o $(TARGET)
|
||||
|
||||
# Release build
|
||||
release:
|
||||
$(CXX) $(CXXFLAGS_RELEASE) $(SRC) -o $(TARGET)
|
||||
|
||||
# Clean
|
||||
clean:
|
||||
rm -f $(TARGET)
|
||||
|
||||
# Phony targets
|
||||
.PHONY: all debug release clean
|
||||
Reference in New Issue
Block a user