From d46f6ee0a6298ff58c6f4f0647d49fb4a76f9ea9 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Thu, 30 Dec 2010 18:06:15 +0100 Subject: Improved Makefile and .gitignore --- .gitignore | 4 +++- note_compiler/.gitignore | 1 + note_compiler/Makefile | 33 +++++++++++++++++++++++++++++++++ synth/.depend | 37 ++++++++++++++++++------------------- synth/Makefile | 8 ++++---- synth/OPTIMIZATIONS | 7 +++++-- 6 files changed, 64 insertions(+), 26 deletions(-) create mode 100644 note_compiler/.gitignore create mode 100644 note_compiler/Makefile diff --git a/.gitignore b/.gitignore index 8862c08..33ec174 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -*.[oa] +*.o +*.so +*.a diff --git a/note_compiler/.gitignore b/note_compiler/.gitignore new file mode 100644 index 0000000..86a7c8e --- /dev/null +++ b/note_compiler/.gitignore @@ -0,0 +1 @@ +compiler diff --git a/note_compiler/Makefile b/note_compiler/Makefile new file mode 100644 index 0000000..bc51697 --- /dev/null +++ b/note_compiler/Makefile @@ -0,0 +1,33 @@ +CXX=g++ +CXXFLAGS=-Wall -g +LDFLAGS=-lm + +OBJ=main.o +BIN=compiler + +DEPENDFILE = .depend + + +SRC = $(OBJ:%.o=%.cpp) + +all: $(BIN) + + +$(BIN): $(OBJ) + $(CXX) $(CFLAGS) -o $(BIN) $(OBJ) $(LDFLAGS) + + +depend dep: $(SRC) + $(CC) -MM $(SRC) > $(DEPENDFILE) + +-include $(DEPENDFILE) + + +%.o: %.cpp + $(CXX) $(CXXFLAGS) -c $< + +.PHONY: clean dep depend + +clean: + rm -f $(OBJ) $(BIN) + diff --git a/synth/.depend b/synth/.depend index 127f9d9..e3e9f6b 100644 --- a/synth/.depend +++ b/synth/.depend @@ -1,28 +1,27 @@ -channel.o: channel.cpp channel.h fixed.h programs.h note.h envelope.h \ - filter.h note_skel.h defines.h util.h globals.h -cli.o: cli.cpp util.h programs.h fixed.h globals.h channel.h note.h \ - envelope.h filter.h note_skel.h defines.h load.h +channel.o: channel.cpp channel.h fixed.h programs.h note_skel.h defines.h \ + util.h globals.h note.h envelope.h filter.h +cli.o: cli.cpp util.h programs.h fixed.h globals.h channel.h note_skel.h \ + defines.h load.h defines.o: defines.cpp defines.h envelope.o: envelope.cpp envelope.h programs.h fixed.h filter.o: filter.cpp filter.h fixed.h defines.h globals.h programs.h \ - channel.h note.h envelope.h note_skel.h util.h -globals.o: globals.cpp globals.h programs.h fixed.h channel.h note.h \ - envelope.h filter.h note_skel.h defines.h util.h -jack.o: jack.cpp defines.h globals.h programs.h fixed.h channel.h note.h \ - envelope.h filter.h note_skel.h util.h jack.h -load.o: load.cpp util.h programs.h fixed.h globals.h channel.h note.h \ - envelope.h filter.h note_skel.h defines.h + channel.h note_skel.h util.h +globals.o: globals.cpp globals.h programs.h fixed.h channel.h note_skel.h \ + defines.h util.h +jack.o: jack.cpp defines.h globals.h programs.h fixed.h channel.h \ + note_skel.h util.h jack.h +load.o: load.cpp util.h programs.h fixed.h globals.h channel.h \ + note_skel.h defines.h main.o: main.cpp jack.h load.h cli.h parser.h fixed.h programs.h \ - channel.h note.h envelope.h filter.h note_skel.h defines.h util.h \ - globals.h + channel.h note_skel.h defines.h util.h globals.h note.o: note.cpp note.h programs.h fixed.h envelope.h filter.h \ note_skel.h globals.h channel.h defines.h util.h note_skel.o: note_skel.cpp note_skel.h programs.h fixed.h globals.h \ - channel.h note.h envelope.h filter.h defines.h util.h + channel.h defines.h util.h parser.o: parser.cpp parser.h fixed.h programs.h defines.h globals.h \ - channel.h note.h envelope.h filter.h note_skel.h util.h readwave.h -programs.o: programs.cpp programs.h fixed.h globals.h channel.h note.h \ - envelope.h filter.h note_skel.h defines.h util.h + channel.h note_skel.h util.h readwave.h +programs.o: programs.cpp programs.h fixed.h globals.h channel.h \ + note_skel.h defines.h util.h readwave.o: readwave.cpp readwave.h programs.h fixed.h util.h -util.o: util.cpp util.h programs.h fixed.h globals.h channel.h note.h \ - envelope.h filter.h note_skel.h defines.h +util.o: util.cpp util.h programs.h fixed.h globals.h channel.h \ + note_skel.h defines.h diff --git a/synth/Makefile b/synth/Makefile index 791e62a..7146da2 100644 --- a/synth/Makefile +++ b/synth/Makefile @@ -14,19 +14,19 @@ all: $(BIN) $(BIN): $(OBJ) - $(CXX) $(CFLAGS) -o synth $(OBJ) $(LDFLAGS) + $(CXX) $(CFLAGS) -o $(BIN) $(OBJ) $(LDFLAGS) -dep: $(SRC) +depend dep: $(SRC) $(CC) -MM $(SRC) > $(DEPENDFILE) -include $(DEPENDFILE) %.o: %.cpp - $(CXX) $(CXXFLAGS) -g -c $< + $(CXX) $(CXXFLAGS) -c $< -.PHONY: clean +.PHONY: clean dep depend clean: rm -f $(OBJ) $(BIN) diff --git a/synth/OPTIMIZATIONS b/synth/OPTIMIZATIONS index 2dd003f..b8bfe0d 100644 --- a/synth/OPTIMIZATIONS +++ b/synth/OPTIMIZATIONS @@ -1,7 +1,7 @@ Sinnlose Optimierungen o if(foo.fm_strength!=0) ...: kein effekt, höchstens leichter anstieg! - Mögliche Optimierungen +Mögliche Optimierungen o 10% filter ganz auf fixed_t umstellen? o 5% envelope::get_level nur alle n frames arbeiten lassen, sonst cachen? o 2% bei LFOs: bei jedem LFO-update die werte für env-max, freqfactor @@ -11,8 +11,11 @@ Sinnlose Optimierungen x 0% beim channel::get_sample: pro note immer mehrere samples auf einmal holen (iterator braucht recht viel leistung) wird von g++ automatisch wegoptimiert -> ok + +Kein negativer Einfluss auf die Performance: + o _virtual_ void Note::get_samples (mit time nicht erkennbar) - Mögliche Bugs und ihre Lösung: +Mögliche Bugs und ihre Lösung: o frequenz wird nicht genau eingehalten: phase um foo*WAVE_RES erhöhen, entsprechend wave[][bar] ändern. ABER: im testfall um bis zu 15% langsamer -- cgit v1.2.1