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
!*.* !*.*
.bash_history .bash_history
.bash_logout .bash_logout
.bashrc .bashrc
...@@ -16,9 +18,8 @@ gain.pd ...@@ -16,9 +18,8 @@ gain.pd
liblo/ liblo/
wav/ wav/
# *
* # *~
*.o *.o
*html/ *html/
*latex/ *latex/
# define the compiler # Parts of this Makefile (especially the explanations) are based on this
CC = g++ # StackOverflow answer:
# path(s) to include files # Specify the name of the executable that will be compiled:
CFLAGS = -I. EXECUTABLE = gain_example
# libraries to link # Specify source code directory:
LDFLAGS = -ljack -llo -lyaml-cpp SRC_DIR = src
# Get a list of all the source files:
SRC = $(wildcard $(SRC_DIR)/*.cpp)
# all sources and dependencies # Specify where to put the object (.o) files:
SRCS = main.cpp gain_example.cpp oscman.cpp yamlman.cpp OBJ_DIR = obj
DEPS = oscman.h gain_example.h yamlman.h # 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) # Required flags to enable the automatic dependency generation by the compiler:
$(CC) -c -o $@ $< $(CFLAGS) CPPFLAGS = -MMD -MP
gain_example: main.o gain_example.o oscman.o yamlman.o # C++ compiler flags:
$(CC) -o gain_example main.o gain_example.o oscman.o yamlman.o $(LDFLAGS) 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
clean: clean:
rm *.o gain_example $(RM) -r $(OBJ_DIR) $(EXECUTABLE)
-include $(DEP)
...@@ -103,4 +103,3 @@ int GainExample::callback_process(jack_nframes_t x, void* object) ...@@ -103,4 +103,3 @@ int GainExample::callback_process(jack_nframes_t x, void* object)
{ {
return static_cast<GainExample*>(object)->process(x); return static_cast<GainExample*>(object)->process(x);
} }
...@@ -60,5 +60,3 @@ double OscMan::get_gain() ...@@ -60,5 +60,3 @@ double OscMan::get_gain()
{ {
return gain; return gain;
} }
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#ifndef OSCMAN_H #ifndef OSCMAN_H
#define OSCMAN_H #define OSCMAN_H
// works with 'self built' // works with 'self built'
#include <lo/lo.h> #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