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 (internal network only) to import your old projects to the new GitLab platform 📥

Commit 604dff2e by Henrik von Coler

Merge branch 'dev' into 'master'

Makefile rewrite: now filename agnostic, cleaner directory structure

See merge request !1
parents b27a51d4 f637c726
......@@ -16,9 +18,8 @@ gain.pd
# *
# *~
# define the compiler
CC = g++
# Parts of this Makefile (especially the explanations) are based on this
# StackOverflow answer:
# path(s) to include files
# Specify the name of the executable that will be compiled:
EXECUTABLE = gain_example
# libraries to link
LDFLAGS = -ljack -llo -lyaml-cpp
# Specify source code directory:
SRC_DIR = src
# Get a list of all the source files:
SRC = $(wildcard $(SRC_DIR)/*.cpp)
# all sources and dependencies
SRCS = main.cpp gain_example.cpp oscman.cpp yamlman.cpp
DEPS = oscman.h gain_example.h yamlman.h
# 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)
all: gain_example
# From the object file list, get the dependency file list to handle automatic
# recompilation when a header file is modified:
DEP = $(OBJ:.o=.d)
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
# Required flags to enable the automatic dependency generation by the compiler:
gain_example: main.o gain_example.o oscman.o yamlman.o
$(CC) -o gain_example main.o gain_example.o oscman.o yamlman.o $(LDFLAGS)
# 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
$(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) $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
# Create obj directory if it doesn't exist:
mkdir $@
# On clean, remove obj directory and executable
rm *.o gain_example
-include $(DEP)
......@@ -103,4 +103,3 @@ int GainExample::callback_process(jack_nframes_t x, void* object)
return static_cast<GainExample*>(object)->process(x);
......@@ -60,5 +60,3 @@ double OscMan::get_gain()
return gain;
......@@ -13,7 +13,7 @@
#ifndef OSCMAN_H
#define OSCMAN_H
// works with 'self built'
#include <lo/lo.h>
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