Skip to content

Commit

Permalink
add shared gui project
Browse files Browse the repository at this point in the history
  • Loading branch information
bbbradsmith committed Apr 11, 2024
1 parent f279a34 commit e30898b
Show file tree
Hide file tree
Showing 15 changed files with 312 additions and 17 deletions.
2 changes: 1 addition & 1 deletion cmd/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ default: $(TARGET)
SRCS = $(wildcard *.cpp)
OBJS = $(addprefix $(CMD_INTDIR)/,$(SRCS:.cpp=.o))
DEPS = $(addprefix $(CMD_INTDIR)/,$(SRCS:.cpp=.d))
CORE = ../$(OUTDIR)/$(LIB_NAME)$(LIB_SUFFIX)
CORE = ../$(OUTDIR)/$(CORE_NAME)$(LIB_SUFFIX)

$(TARGET): $(OBJS) $(CORE) | $(dir $(TARGET))
$(CXX) -o $(TARGET) $(LDFLAGS) $(LDFLAGS_CMD) $(OBJS) $(CORE)
Expand Down
2 changes: 1 addition & 1 deletion core/makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../makefile.common

TARGETFILE ?= $(LIB_NAME)$(LIB_SUFFIX)
TARGETFILE ?= $(CORE_NAME)$(LIB_SUFFIX)
TARGET ?= ../$(OUTDIR)/$(TARGETFILE)
CORE_INTDIR ?= ../$(INTDIR)/core

Expand Down
8 changes: 8 additions & 0 deletions gui/gui.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// stub

#include <nsfplaygui.h>

int nsfplaygui::test()
{
return 4;
}
186 changes: 186 additions & 0 deletions gui/gui.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{62ffe7e8-a311-4603-a4c0-8d438230eba5}</ProjectGuid>
<RootNamespace>gui</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(SolutionDir)intermediate\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
<OutDir>$(SolutionDir)output\$(Platform)\$(Configuration)\</OutDir>
<TargetName>nsfgui</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(SolutionDir)intermediate\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
<OutDir>$(SolutionDir)output\$(Platform)\$(Configuration)\</OutDir>
<TargetName>nsfgui</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(SolutionDir)intermediate\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
<OutDir>$(SolutionDir)output\$(Platform)\$(Configuration)\</OutDir>
<TargetName>nsfgui</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(SolutionDir)intermediate\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
<OutDir>$(SolutionDir)output\$(Platform)\$(Configuration)\</OutDir>
<TargetName>nsfgui</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalIncludeDirectories>..\include\</AdditionalIncludeDirectories>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>..\include\</AdditionalIncludeDirectories>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalIncludeDirectories>..\include\</AdditionalIncludeDirectories>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>..\include\</AdditionalIncludeDirectories>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="gui.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\nsfplaygui.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
33 changes: 33 additions & 0 deletions gui/gui.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="framework.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="pch.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="gui.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
35 changes: 35 additions & 0 deletions gui/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
include ../makefile.common

TARGETFILE ?= $(GUI_NAME)$(LIB_SUFFIX)
TARGET ?= ../$(OUTDIR)/$(TARGETFILE)
GUI_INTDIR ?= ../$(INTDIR)/gui

.PHONY: default clean

default: $(TARGET)

SRCS = $(wildcard *.cpp)
OBJS = $(addprefix $(GUI_INTDIR)/,$(SRCS:.cpp=.o))
DEPS = $(addprefix $(GUI_INTDIR)/,$(SRCS:.cpp=.d))

$(TARGET): $(OBJS) | $(dir $(TARGET))
rm -f $(TARGET)
$(AR) rcs $(TARGET) $(OBJS)

$(GUI_INTDIR)/%.d: %.cpp | $(GUI_INTDIR)/
$(CXX) -M -MM -MF $@ -MT $(GUI_INTDIR)/$(basename $<).o $(CXXFLAGS) -c $<

$(GUI_INTDIR)/%.o: %.cpp $(GUI_INTDIR)/%.d | $(GUI_INTDIR)/
$(CXX) -o $@ $(CXXFLAGS) -c $<

$(GUI_INTDIR)/:
$(MKDIR) $@

$(dir $(TARGET)):
$(MKDIR) $@

clean:
rm -rf $(GUI_INTDIR)
rm -rf $(dir $(TARGET))

include $(DEPS)
9 changes: 9 additions & 0 deletions include/nsfplaygui.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// stub

// this is the public interface to the gui library
namespace nsfplaygui
{

int test();

};
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ cmd: core
gui: core
$(MAKE) -C gui

nsfplay: core
nsfplay: core gui
$(MAKE) -C nsfplay

winamp: core
winamp: core gui
$(MAKE) -C winamp

install: cmd
Expand Down
2 changes: 1 addition & 1 deletion makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ LIB_SUFFIX ?= .a
EXE_SUFFIX ?= .exe
DLL_SUFFIX ?= .dll

LIB_NAME ?= nsfcore
CORE_NAME ?= nsfcore
CMD_NAME ?= nsfplac
GUI_NAME ?= nsfgui
NSFPLAY_NAME ?= nsfplay
Expand Down
12 changes: 12 additions & 0 deletions nsfplay.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winamp", "winamp\winamp.vcxproj", "{4564B30C-656E-4897-8036-42E4A3E88FBE}"
ProjectSection(ProjectDependencies) = postProject
{E492BA81-E2F5-439C-B42E-A3E26C82DDFB} = {E492BA81-E2F5-439C-B42E-A3E26C82DDFB}
{62FFE7E8-A311-4603-A4C0-8D438230EBA5} = {62FFE7E8-A311-4603-A4C0-8D438230EBA5}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nsfplay", "nsfplay\nsfplay.vcxproj", "{D3EC4B41-9124-4C7E-B2B8-01E85EEC750D}"
ProjectSection(ProjectDependencies) = postProject
{E492BA81-E2F5-439C-B42E-A3E26C82DDFB} = {E492BA81-E2F5-439C-B42E-A3E26C82DDFB}
{62FFE7E8-A311-4603-A4C0-8D438230EBA5} = {62FFE7E8-A311-4603-A4C0-8D438230EBA5}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gui", "gui\gui.vcxproj", "{62FFE7E8-A311-4603-A4C0-8D438230EBA5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand Down Expand Up @@ -58,6 +62,14 @@ Global
{D3EC4B41-9124-4C7E-B2B8-01E85EEC750D}.Release|x64.Build.0 = Release|x64
{D3EC4B41-9124-4C7E-B2B8-01E85EEC750D}.Release|x86.ActiveCfg = Release|Win32
{D3EC4B41-9124-4C7E-B2B8-01E85EEC750D}.Release|x86.Build.0 = Release|Win32
{62FFE7E8-A311-4603-A4C0-8D438230EBA5}.Debug|x64.ActiveCfg = Debug|x64
{62FFE7E8-A311-4603-A4C0-8D438230EBA5}.Debug|x64.Build.0 = Debug|x64
{62FFE7E8-A311-4603-A4C0-8D438230EBA5}.Debug|x86.ActiveCfg = Debug|Win32
{62FFE7E8-A311-4603-A4C0-8D438230EBA5}.Debug|x86.Build.0 = Debug|Win32
{62FFE7E8-A311-4603-A4C0-8D438230EBA5}.Release|x64.ActiveCfg = Release|x64
{62FFE7E8-A311-4603-A4C0-8D438230EBA5}.Release|x64.Build.0 = Release|x64
{62FFE7E8-A311-4603-A4C0-8D438230EBA5}.Release|x86.ActiveCfg = Release|Win32
{62FFE7E8-A311-4603-A4C0-8D438230EBA5}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
10 changes: 7 additions & 3 deletions nsfplay/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ default: $(TARGET)
SRCS = $(wildcard *.cpp)
OBJS = $(addprefix $(NSFPLAY_INTDIR)/,$(SRCS:.cpp=.o))
DEPS = $(addprefix $(NSFPLAY_INTDIR)/,$(SRCS:.cpp=.d))
CORE = ../$(OUTDIR)/$(LIB_NAME)$(LIB_SUFFIX)
CORE = ../$(OUTDIR)/$(CORE_NAME)$(LIB_SUFFIX)
GUI = ../$(OUTDIR)/$(GUI_NAME)$(LIB_SUFFIX)

ifeq ($(OS),Windows_NT)
OBJS += $(NSFPLAY_INTDIR)/nsfplay_rc.o
endif

$(TARGET): $(OBJS) $(CORE) | $(dir $(TARGET))
$(CXX) -o $(TARGET) $(LDFLAGS) $(LDFLAGS_NSFPLAY) $(OBJS) $(CORE)
$(TARGET): $(OBJS) $(CORE) $(GUI) | $(dir $(TARGET))
$(CXX) -o $(TARGET) $(LDFLAGS) $(LDFLAGS_NSFPLAY) $(OBJS) $(CORE) $(GUI)
$(STRIP_DEBUG)

$(NSFPLAY_INTDIR)/%.d: %.cpp | $(NSFPLAY_INTDIR)/
Expand All @@ -40,6 +41,9 @@ $(dir $(TARGET)):
$(CORE):
$(MAKE) -C ../core

$(GUI):
$(MAKE) -C ../gui

install: $(TARGET)
$(MKDIR) $(dir $(NSFPLAY_INSTALL))
cp $(TARGET) $(NSFPLAY_INSTALL)
Expand Down
Loading

0 comments on commit e30898b

Please sign in to comment.