This GitLab instance reached the end of its service life. It won't be possible to create new users or projects.

Please read the deprecation notice for more information concerning the deprecation timeline

Visit migration.git.tu-berlin.de (internal network only) to import your old projects to the new GitLab platform 📥

Commit ea2f3c50 by Jonas Margraf

comment Makefile

parent f9005ff9
EXECUTABLE = gain_example
# path(s) to include files
CFLAGS = -std=c++11 -Wall -I.
# Parts of this Makefile (especially the explanations) are based on this
# StackOverflow answer:
# https://stackoverflow.com/a/31610364
# libraries to link
LDFLAGS = -ljack -llo -lyaml-cpp
# Specify the name of the executable that will be compiled:
EXECUTABLE = gain_example
# Specify source code directory:
SRC_DIR = src
OBJ_DIR = obj
# all sources and dependencies
# Get a list of all the source files:
SRC = $(wildcard $(SRC_DIR)/*.cpp)
# Specify where to put the object (.o) files:
OBJ_DIR = obj
# Get a list of the object files that correspond to the source files:
OBJ = $(SRC:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o)
# From the object file list, get the dependency file list to handle automatic
# recompilation when a header file is modified:
DEP = $(OBJ:.o=.d)
# Required flags to enable the automatic dependency generation by the compiler:
CPPFLAGS = -MMD -MP
# C++ compiler flags:
CXXFLAGS = -std=c++11 -Wall -I.
# Libraries to link (linker flags):
LDFLAGS = -ljack -llo -lyaml-cpp -lsndfile
# Tell make that these target are not real files:
.PHONY: all clean
all: $(EXECUTABLE)
......@@ -21,12 +36,16 @@ all: $(EXECUTABLE)
$(EXECUTABLE): $(OBJ)
$(CXX) $(LDFLAGS) $^ -o $@
# The build directory is custom so we need to tell make how to do it, also it
# must exist before trying to compile:
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp | $(OBJ_DIR)
$(CXX) $(CFLAGS) -o $@ -c $<
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
# Create obj directory if it doesn't exist:
$(OBJ_DIR):
mkdir $@
# On clean, remove obj directory and executable
clean:
$(RM) -r $(OBJ_DIR) $(EXECUTABLE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment