From 4fad20f754c754b6bd1cacadc3016babb3188bcf Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 12 Jun 2021 13:14:01 +0200 Subject: Comparison using dg sources --- Makefile.dg | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ cppbuild.cc | 135 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- task.cc | 13 ++++-- 3 files changed, 267 insertions(+), 9 deletions(-) create mode 100644 Makefile.dg diff --git a/Makefile.dg b/Makefile.dg new file mode 100644 index 0000000..548c0cb --- /dev/null +++ b/Makefile.dg @@ -0,0 +1,128 @@ +SRC = \ + drumgizmo/src/audiocache.cc \ + drumgizmo/src/audiocacheeventhandler.cc \ + drumgizmo/src/audiocachefile.cc \ + drumgizmo/src/audiocacheidmanager.cc \ + drumgizmo/src/audiofile.cc \ + drumgizmo/src/audioinputengine.cc \ + drumgizmo/src/audioinputenginemidi.cc \ + drumgizmo/src/audiooutputengine.cc \ + drumgizmo/src/bytesizeparser.cc \ + drumgizmo/src/channel.cc \ + drumgizmo/src/channelmixer.cc \ + drumgizmo/src/configfile.cc \ + drumgizmo/src/configparser.cc \ + drumgizmo/src/dgxmlparser.cc \ + drumgizmo/src/directory.cc \ + drumgizmo/src/domloader.cc \ + drumgizmo/src/drumgizmo.cc \ + drumgizmo/src/drumgizmoconf.cc \ + drumgizmo/src/drumkit.cc \ + drumgizmo/src/drumkitloader.cc \ + drumgizmo/src/events.cc \ + drumgizmo/src/events_ds.cc \ + drumgizmo/src/inputprocessor.cc \ + drumgizmo/src/instrument.cc \ + drumgizmo/src/latencyfilter.cc \ + drumgizmo/src/midimapparser.cc \ + drumgizmo/src/midimapper.cc \ + drumgizmo/src/path.cc \ + drumgizmo/src/powerlist.cc \ + drumgizmo/src/powermap.cc \ + drumgizmo/src/powermapfilter.cc \ + drumgizmo/src/random.cc \ + drumgizmo/src/sample.cc \ + drumgizmo/src/sample_selection.cc \ + drumgizmo/src/sem.cc \ + drumgizmo/src/staminafilter.cc \ + drumgizmo/src/thread.cc \ + drumgizmo/src/translation.cc \ + drumgizmo/src/velocityfilter.cc \ + drumgizmo/src/versionstr.cc \ + drumgizmo/src/zrwrapper.cc \ + drumgizmo/plugingui/abouttab.cc \ + drumgizmo/plugingui/bleedcontrolframecontent.cc \ + drumgizmo/plugingui/button.cc \ + drumgizmo/plugingui/button_base.cc \ + drumgizmo/plugingui/checkbox.cc \ + drumgizmo/plugingui/colour.cc \ + drumgizmo/plugingui/combobox.cc \ + drumgizmo/plugingui/dialog.cc \ + drumgizmo/plugingui/diskstreamingframecontent.cc \ + drumgizmo/plugingui/drumkitframecontent.cc \ + drumgizmo/plugingui/drumkittab.cc \ + drumgizmo/plugingui/eventhandler.cc \ + drumgizmo/plugingui/filebrowser.cc \ + drumgizmo/plugingui/font.cc \ + drumgizmo/plugingui/frame.cc \ + drumgizmo/plugingui/helpbutton.cc \ + drumgizmo/plugingui/humaniservisualiser.cc \ + drumgizmo/plugingui/humanizerframecontent.cc \ + drumgizmo/plugingui/image.cc \ + drumgizmo/plugingui/imagecache.cc \ + drumgizmo/plugingui/knob.cc \ + drumgizmo/plugingui/label.cc \ + drumgizmo/plugingui/layout.cc \ + drumgizmo/plugingui/led.cc \ + drumgizmo/plugingui/lineedit.cc \ + drumgizmo/plugingui/listbox.cc \ + drumgizmo/plugingui/listboxbasic.cc \ + drumgizmo/plugingui/listboxthin.cc \ + drumgizmo/plugingui/maintab.cc \ + drumgizmo/plugingui/mainwindow.cc \ + drumgizmo/plugingui/nativewindow_x11.cc \ + drumgizmo/plugingui/painter.cc \ + drumgizmo/plugingui/pixelbuffer.cc \ + drumgizmo/plugingui/pluginconfig.cc \ + drumgizmo/plugingui/powerbutton.cc \ + drumgizmo/plugingui/powerwidget.cc \ + drumgizmo/plugingui/progressbar.cc \ + drumgizmo/plugingui/resamplingframecontent.cc \ + drumgizmo/plugingui/resource.cc \ + drumgizmo/plugingui/resource_data.cc \ + drumgizmo/plugingui/sampleselectionframecontent.cc \ + drumgizmo/plugingui/scrollbar.cc \ + drumgizmo/plugingui/slider.cc \ + drumgizmo/plugingui/stackedwidget.cc \ + drumgizmo/plugingui/statusframecontent.cc \ + drumgizmo/plugingui/tabbutton.cc \ + drumgizmo/plugingui/tabwidget.cc \ + drumgizmo/plugingui/testmain.cc \ + drumgizmo/plugingui/textedit.cc \ + drumgizmo/plugingui/texture.cc \ + drumgizmo/plugingui/texturedbox.cc \ + drumgizmo/plugingui/timingframecontent.cc \ + drumgizmo/plugingui/toggle.cc \ + drumgizmo/plugingui/tooltip.cc \ + drumgizmo/plugingui/uitranslation.cc \ + drumgizmo/plugingui/utf8.cc \ + drumgizmo/plugingui/verticalline.cc \ + drumgizmo/plugingui/visualizerframecontent.cc \ + drumgizmo/plugingui/voicelimitframecontent.cc \ + drumgizmo/plugingui/widget.cc \ + drumgizmo/plugingui/window.cc \ + drumgizmo/zita-resampler/libs/cresampler.cc \ + drumgizmo/zita-resampler/libs/resampler-table.cc \ + drumgizmo/zita-resampler/libs/resampler.cc \ + drumgizmo/zita-resampler/libs/vresampler.cc \ + drumgizmo/hugin/hugin.c \ + drumgizmo/pugixml/src/pugixml.cpp \ + drumgizmo/plugingui/lodepng/lodepng.cpp \ + +OBJ = $(patsubst %.c,%.o,$(patsubst %.cc,%.o,$(patsubst %.cpp,%.o,$(SRC)))) + +CXXFLAGS = -DUI_X11 -g -Wall -Werror -std=c++11 -Idrumgizmo/getoptpp -Idrumgizmo/ -Idrumgizmo/hugin -Idrumgizmo/plugingui/ -Idrumgizmo/src/ -Idrumgizmo/zita-resampler/libs -Idrumgizmo/pugixml/src +CFLAGS = -g -Wall -Werror +LDFLAGS = -lm -lX11 -lXext -pthread -lsndfile + +%.o: %.c + gcc $(CFLAGS) -c $< -o $@ + +%.o: %.cc + gcc $(CXXFLAGS) -c $< -o $@ + +plugingui: $(OBJ) + g++ $(OBJ) $(LDFLAGS) -o plugingui + +clean: + rm -f plugingui $(OBJ) diff --git a/cppbuild.cc b/cppbuild.cc index 275512f..d7c0537 100644 --- a/cppbuild.cc +++ b/cppbuild.cc @@ -1,3 +1,15 @@ +#if 0 +if [ "cppbuild" -ot "$0" ]; then + echo "Rebuilding cppbuild" + g++ -std=c++17 -pthread $0 libcppbuild.a -o cppbuild + [ $? != 0 ] && exit 1 +fi + +echo "Launching cppbuild" +./cppbuild $* +exit $? +#endif + #include #include #include @@ -9,17 +21,128 @@ BuildConfiguration configs() return { // target - "bas", + "plugingui", + + // source files { - // source files - "src/foo.cc", - "src/bar.cc", + "drumgizmo/src/audiocache.cc", + "drumgizmo/src/audiocacheeventhandler.cc", + "drumgizmo/src/audiocachefile.cc", + "drumgizmo/src/audiocacheidmanager.cc", + "drumgizmo/src/audiofile.cc", + "drumgizmo/src/audioinputengine.cc", + "drumgizmo/src/audioinputenginemidi.cc", + "drumgizmo/src/audiooutputengine.cc", + "drumgizmo/src/bytesizeparser.cc", + "drumgizmo/src/channel.cc", + "drumgizmo/src/channelmixer.cc", + "drumgizmo/src/configfile.cc", + "drumgizmo/src/configparser.cc", + "drumgizmo/src/dgxmlparser.cc", + "drumgizmo/src/directory.cc", + "drumgizmo/src/domloader.cc", + "drumgizmo/src/drumgizmo.cc", + "drumgizmo/src/drumgizmoconf.cc", + "drumgizmo/src/drumkit.cc", + "drumgizmo/src/drumkitloader.cc", + "drumgizmo/src/events.cc", + "drumgizmo/src/events_ds.cc", + "drumgizmo/src/inputprocessor.cc", + "drumgizmo/src/instrument.cc", + "drumgizmo/src/latencyfilter.cc", + "drumgizmo/src/midimapparser.cc", + "drumgizmo/src/midimapper.cc", + "drumgizmo/src/path.cc", + "drumgizmo/src/powerlist.cc", + "drumgizmo/src/powermap.cc", + "drumgizmo/src/powermapfilter.cc", + "drumgizmo/src/random.cc", + "drumgizmo/src/sample.cc", + "drumgizmo/src/sample_selection.cc", + "drumgizmo/src/sem.cc", + "drumgizmo/src/staminafilter.cc", + "drumgizmo/src/thread.cc", + "drumgizmo/src/translation.cc", + "drumgizmo/src/velocityfilter.cc", + "drumgizmo/src/versionstr.cc", + "drumgizmo/src/zrwrapper.cc", + "drumgizmo/plugingui/abouttab.cc", + "drumgizmo/plugingui/bleedcontrolframecontent.cc", + "drumgizmo/plugingui/button.cc", + "drumgizmo/plugingui/button_base.cc", + "drumgizmo/plugingui/checkbox.cc", + "drumgizmo/plugingui/colour.cc", + "drumgizmo/plugingui/combobox.cc", + "drumgizmo/plugingui/dialog.cc", + "drumgizmo/plugingui/diskstreamingframecontent.cc", + "drumgizmo/plugingui/drumkitframecontent.cc", + "drumgizmo/plugingui/drumkittab.cc", + "drumgizmo/plugingui/eventhandler.cc", + "drumgizmo/plugingui/filebrowser.cc", + "drumgizmo/plugingui/font.cc", + "drumgizmo/plugingui/frame.cc", + "drumgizmo/plugingui/helpbutton.cc", + "drumgizmo/plugingui/humaniservisualiser.cc", + "drumgizmo/plugingui/humanizerframecontent.cc", + "drumgizmo/plugingui/image.cc", + "drumgizmo/plugingui/imagecache.cc", + "drumgizmo/plugingui/knob.cc", + "drumgizmo/plugingui/label.cc", + "drumgizmo/plugingui/layout.cc", + "drumgizmo/plugingui/led.cc", + "drumgizmo/plugingui/lineedit.cc", + "drumgizmo/plugingui/listbox.cc", + "drumgizmo/plugingui/listboxbasic.cc", + "drumgizmo/plugingui/listboxthin.cc", + "drumgizmo/plugingui/maintab.cc", + "drumgizmo/plugingui/mainwindow.cc", + "drumgizmo/plugingui/nativewindow_x11.cc", + "drumgizmo/plugingui/painter.cc", + "drumgizmo/plugingui/pixelbuffer.cc", + "drumgizmo/plugingui/pluginconfig.cc", + "drumgizmo/plugingui/powerbutton.cc", + "drumgizmo/plugingui/powerwidget.cc", + "drumgizmo/plugingui/progressbar.cc", + "drumgizmo/plugingui/resamplingframecontent.cc", + "drumgizmo/plugingui/resource.cc", + "drumgizmo/plugingui/resource_data.cc", + "drumgizmo/plugingui/sampleselectionframecontent.cc", + "drumgizmo/plugingui/scrollbar.cc", + "drumgizmo/plugingui/slider.cc", + "drumgizmo/plugingui/stackedwidget.cc", + "drumgizmo/plugingui/statusframecontent.cc", + "drumgizmo/plugingui/tabbutton.cc", + "drumgizmo/plugingui/tabwidget.cc", + "drumgizmo/plugingui/testmain.cc", + "drumgizmo/plugingui/textedit.cc", + "drumgizmo/plugingui/texture.cc", + "drumgizmo/plugingui/texturedbox.cc", + "drumgizmo/plugingui/timingframecontent.cc", + "drumgizmo/plugingui/toggle.cc", + "drumgizmo/plugingui/tooltip.cc", + "drumgizmo/plugingui/uitranslation.cc", + "drumgizmo/plugingui/utf8.cc", + "drumgizmo/plugingui/verticalline.cc", + "drumgizmo/plugingui/visualizerframecontent.cc", + "drumgizmo/plugingui/voicelimitframecontent.cc", + "drumgizmo/plugingui/widget.cc", + "drumgizmo/plugingui/window.cc", + "drumgizmo/zita-resampler/libs/cresampler.cc", + "drumgizmo/zita-resampler/libs/resampler-table.cc", + "drumgizmo/zita-resampler/libs/resampler.cc", + "drumgizmo/zita-resampler/libs/vresampler.cc", + "drumgizmo/hugin/hugin.c", + "drumgizmo/pugixml/src/pugixml.cpp", + "drumgizmo/plugingui/lodepng/lodepng.cpp", }, + // cxx flags - "-g -Wall -Werror -std=c++17", + "-DUI_X11 -g -Wall -Werror -std=c++11 -Idrumgizmo/getoptpp -Idrumgizmo/ -Idrumgizmo/hugin -Idrumgizmo/plugingui/ -Idrumgizmo/src/ -Idrumgizmo/zita-resampler/libs -Idrumgizmo/pugixml/src", + // c flags "-g -Wall -Werror", + // linker flags - "-lm", + "-lm -lX11 -lXext -pthread -lsndfile", }; } diff --git a/task.cc b/task.cc index 19e4712..4dcbbd8 100644 --- a/task.cc +++ b/task.cc @@ -156,9 +156,16 @@ void Task::start() if(recompile) { - std::string cmd = - "g++ -MMD -c " + std::string(sourceFile) + " " + - config.cxxflags + " " + + std::string comp = "g++"; + std::string flags = config.cxxflags; + if(std::string(sourceFile.extension()) == ".c") + { + comp = "gcc"; + flags = config.cflags; + } + std::string cmd = comp + + " -MMD -c " + std::string(sourceFile) + " " + + flags + " " + "-o " + std::string(targetFile); std::cout << cmd << "\n"; -- cgit v1.2.3