aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2022-02-09 01:09:19 +0100
committerJavier <dev.git@javispedro.com>2022-02-09 01:09:19 +0100
commite575d4df4c5c0cd67bb031361e09ec497562934d (patch)
tree5d0f1151109d7a8fd5f9b547c4fd64193205cad5
parent9314830b7674e670807ef210d1e408c7be79947e (diff)
downloadvmusic-e575d4df4c5c0cd67bb031361e09ec497562934d.tar.gz
vmusic-e575d4df4c5c0cd67bb031361e09ec497562934d.zip
cleanup makefile, build-time disable verbose logging by default
-rw-r--r--Adlib.cpp6
-rw-r--r--Emu8000.cpp2
-rw-r--r--Makefile38
-rw-r--r--Mpu401.cpp2
-rw-r--r--emu8k.c2
-rw-r--r--midialsa.cpp2
-rw-r--r--pcmalsa.cpp2
-rw-r--r--scripts/logenv.sh2
-rwxr-xr-xscripts/try.sh2
9 files changed, 32 insertions, 26 deletions
diff --git a/Adlib.cpp b/Adlib.cpp
index b5ec4c4..ef70055 100644
--- a/Adlib.cpp
+++ b/Adlib.cpp
@@ -47,8 +47,6 @@
/*********************************************************************************************************************************
* Header Files *
*********************************************************************************************************************************/
-#define LOG_ENABLED 1
-#define LOG_ENABLE_FLOW 1
#define LOG_GROUP LOG_GROUP_DEV_SB16
// Log level 3 is used for register reads/writes
// Log level 7 is used for all port in/out
@@ -95,10 +93,10 @@ enum {
#define ADLIB_SAVED_STATE_VERSION 1
/** Maximum number of sound samples render in one batch by render thread. */
-#define ADLIB_RENDER_BLOCK_TIME 5 /* in millisec */
+#define ADLIB_RENDER_BLOCK_TIME 5 /* in millisec */
/** The render thread will shutdown if this time passes since the last OPL register write. */
-#define ADLIB_RENDER_SUSPEND_TIMEOUT 5000 /* in millisec */
+#define ADLIB_RENDER_SUSPEND_TIMEOUT 5000 /* in millisec */
#define OPL2_NUM_IO_PORTS 2
#define OPL3_NUM_IO_PORTS 4
diff --git a/Emu8000.cpp b/Emu8000.cpp
index 0497982..a28f0dd 100644
--- a/Emu8000.cpp
+++ b/Emu8000.cpp
@@ -47,8 +47,6 @@
/*********************************************************************************************************************************
* Header Files *
*********************************************************************************************************************************/
-#define LOG_ENABLED 1
-#define LOG_ENABLE_FLOW 1
#define LOG_GROUP LOG_GROUP_DEV_SB16
// Log level 3 is used for register reads/writes
// Log level 7 is used for all port in/out
diff --git a/Makefile b/Makefile
index 16e8780..6cb628f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,16 @@
-
+# Settings
# Either linux.amd64 or win.amd64
OS:=linux
ARCH:=amd64
+CFLAGS?=-O2 -g -pipe
+CXXFLAGS?=-O2 -g -pipe
+
+# 1 enables verbose logging
+#LOG:=1
+
+# Settings end here
+
# Directories
VBOXSRC:=VirtualBox.src
VBOXBIN:=VirtualBox.$(OS).$(ARCH)
@@ -45,10 +53,18 @@ CXX=g++
endif
# Compiler flags
-VBOX_DEFINES:=-DVBOX_HAVE_VISIBILITY_HIDDEN -DRT_USE_VISIBILITY_DEFAULT -DVBOX -DVBOX_OSE -DVBOX_WITH_64_BITS_GUESTS -DVBOX_WITH_DEBUGGER -DIN_RING3 -DGC_ARCH_BITS=64 -DVBOX_WITH_DTRACE -DVBOX_WITH_DTRACE_R3 -DPIC -DVBOX_IN_EXTPACK -DVBOX_IN_EXTPACK_R3 -DHC_ARCH_BITS=64
-VBOX_CFLAGS:=-pedantic -Wshadow -Wall -Wextra -Wno-missing-field-initializers -Wno-unused -Wno-trigraphs -fdiagnostics-show-option -Wno-unused-parameter -Wlogical-op -Wno-variadic-macros -Wno-long-long -Wunused-variable -Wunused-function -Wunused-label -Wunused-parameter -Wno-array-bounds -Wno-ignored-qualifiers -Wno-variadic-macros -fno-omit-frame-pointer -fno-strict-aliasing -fvisibility=hidden -fno-exceptions -I$(VBOXSRC)/include -Iinclude
+ifeq "$(LOG)" "1"
+VMUSIC_DEFINES:=-DLOG_ENABLED=1 -DLOG_ENABLE_FLOW=1
+endif
+
+VBOX_DEFINES:=-DVBOX_HAVE_VISIBILITY_HIDDEN -DRT_USE_VISIBILITY_DEFAULT -DVBOX -DVBOX_OSE -DVBOX_WITH_64_BITS_GUESTS -DVBOX_WITH_DEBUGGER \
+ -DIN_RING3 -DGC_ARCH_BITS=64 -DVBOX_WITH_DTRACE -DVBOX_WITH_DTRACE_R3 -DPIC -DVBOX_IN_EXTPACK -DVBOX_IN_EXTPACK_R3 -DHC_ARCH_BITS=64
+VBOX_CFLAGS:=-fPIC -m64 -pedantic -Wshadow -Wall -Wextra \
+ -Wno-missing-field-initializers -Wno-unused -Wno-trigraphs -fdiagnostics-show-option -Wno-unused-parameter -Wlogical-op -Wno-variadic-macros -Wno-long-long -Wunused-variable -Wunused-function -Wunused-label -Wunused-parameter -Wno-array-bounds -Wno-ignored-qualifiers -Wno-variadic-macros -fno-omit-frame-pointer -fno-strict-aliasing \
+ -fvisibility=hidden -fno-exceptions \
+ -I$(VBOXSRC)/include -Iinclude
VBOX_CXXFLAGS:=$(VBOX_CFLAGS) -Wno-overloaded-virtual -fvisibility-inlines-hidden -fno-rtti
-VBOX_LDFLAGS:=
+VBOX_LDFLAGS:=-fPIC -m64
VBOX_LIBS:=$(VBOXBIN)/VBoxRT.$(SO) $(VBOXBIN)/VBoxVMM.$(SO)
ifeq "$(OS)" "win"
@@ -71,25 +87,25 @@ $(OUTDIR) $(OBJDIR) $(OBJOSDIR) $(OUTOSDIR): %:
mkdir -p $@
$(OBJOSDIR)/%.o: %.cpp | $(OBJOSDIR)
- $(CXX) -c -O2 -g -pipe -fPIC -m64 $(VBOX_CXXFLAGS) $(VBOX_DEFINES) -o $@ $<
+ $(CXX) -c $(VBOX_CXXFLAGS) $(VBOX_DEFINES) $(VMUSIC_DEFINES) $(CXXFLAGS) -o $@ $<
$(OBJOSDIR)/%.o: %.c | $(OBJOSDIR)
- $(CC) -c -O2 -g -pipe -fPIC -m64 $(VBOX_CFLAGS) $(VBOX_DEFINES) -o $@ $<
+ $(CC) -c $(VBOX_CFLAGS) $(VBOX_DEFINES) $(VMUSIC_DEFINES) $(CFLAGS) -o $@ $<
$(OUTOSDIR)/VMusicMain.$(SO): $(OBJOSDIR)/VMusicMain.o | $(OUTOSDIR)
- $(CXX) -shared -fPIC -m64 $(VBOX_LDFLAGS) -o $@ $+ $(VBOX_LIBS)
+ $(CXX) -shared $(VBOX_LDFLAGS) -o $@ $+ $(VBOX_LIBS)
$(OUTOSDIR)/VMusicMainVM.$(SO): $(OBJOSDIR)/VMusicMainVM.o | $(OUTOSDIR)
- $(CXX) -shared -fPIC -m64 $(VBOX_LDFLAGS) -o $@ $+ $(VBOX_LIBS)
+ $(CXX) -shared $(VBOX_LDFLAGS) -o $@ $+ $(VBOX_LIBS)
$(OUTOSDIR)/AdlibR3.$(SO): $(ADLIBR3OBJ) | $(OUTOSDIR)
- $(CXX) -shared -fPIC -m64 $(VBOX_LDFLAGS) -o $@ $+ $(VBOX_LIBS) $(ADLIBR3LIBS)
+ $(CXX) -shared $(VBOX_LDFLAGS) -o $@ $+ $(VBOX_LIBS) $(ADLIBR3LIBS)
$(OUTOSDIR)/Mpu401R3.$(SO): $(MPU401R3OBJ) | $(OUTOSDIR)
- $(CXX) -shared -fPIC -m64 $(VBOX_LDFLAGS) -o $@ $+ $(VBOX_LIBS) $(MPU401R3LIBS)
+ $(CXX) -shared $(VBOX_LDFLAGS) -o $@ $+ $(VBOX_LIBS) $(MPU401R3LIBS)
$(OUTOSDIR)/Emu8000R3.$(SO): $(EMU8000R3OBJ) | $(OUTOSDIR)
- $(CXX) -shared -fPIC -m64 $(VBOX_LDFLAGS) -o $@ $+ $(VBOX_LIBS) $(EMU8000R3LIBS)
+ $(CXX) -shared $(VBOX_LDFLAGS) -o $@ $+ $(VBOX_LIBS) $(EMU8000R3LIBS)
$(OUTDIR)/ExtPack.xml: ExtPack.xml
install -m 0644 $< $@
diff --git a/Mpu401.cpp b/Mpu401.cpp
index 7754fd6..450aedd 100644
--- a/Mpu401.cpp
+++ b/Mpu401.cpp
@@ -47,8 +47,6 @@
/*********************************************************************************************************************************
* Header Files *
*********************************************************************************************************************************/
-#define LOG_ENABLED 1
-#define LOG_ENABLE_FLOW 1
#define LOG_GROUP LOG_GROUP_DEV_SB16
// Log level 3 is used for commands, responses, etc.
// Log level 5 is used for MIDI data in/out
diff --git a/emu8k.c b/emu8k.c
index b41cf82..2d3d9a0 100644
--- a/emu8k.c
+++ b/emu8k.c
@@ -38,8 +38,6 @@
#include <math.h>
-#define LOG_ENABLED 1
-#define LOG_ENABLE_FLOW 1
#define LOG_GROUP LOG_GROUP_DEV_SB16
#include <VBox/log.h>
#include <iprt/assert.h>
diff --git a/midialsa.cpp b/midialsa.cpp
index ff2c41f..1c84eb9 100644
--- a/midialsa.cpp
+++ b/midialsa.cpp
@@ -16,8 +16,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-//#define LOG_ENABLED 1
-//#define LOG_ENABLE_FLOW 1
#define LOG_GROUP LOG_GROUP_DEV_SB16
#include <iprt/assert.h>
diff --git a/pcmalsa.cpp b/pcmalsa.cpp
index a80befd..45d49b4 100644
--- a/pcmalsa.cpp
+++ b/pcmalsa.cpp
@@ -16,8 +16,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#define LOG_ENABLED 1
-#define LOG_ENABLE_FLOW 1
#define LOG_GROUP LOG_GROUP_DEV_SB16
#include <VBox/err.h>
diff --git a/scripts/logenv.sh b/scripts/logenv.sh
index 53de2db..e253426 100644
--- a/scripts/logenv.sh
+++ b/scripts/logenv.sh
@@ -1,6 +1,6 @@
export VBOX_LOG_DEST="nofile stderr"
export VBOX_LOG_FLAGS="thread time"
-export VBOX_LOG="+dev_sb16.e.l.f"
+export VBOX_LOG="+dev_sb16.e.l.f.l3.l5.l7.l9"
export VBOX_RELEASE_LOG_DEST="nofile stderr"
export VBOX_RELEASE_LOG="-all +dev_sb16.e.l.f"
diff --git a/scripts/try.sh b/scripts/try.sh
index 0f88c1d..da5c31e 100755
--- a/scripts/try.sh
+++ b/scripts/try.sh
@@ -11,4 +11,6 @@ fi
source scripts/logenv.sh
+# --debug
+
exec /usr/lib/virtualbox/VirtualBoxVM --startvm "$vm"