Skip to content

Commit

Permalink
refactor: Move header files
Browse files Browse the repository at this point in the history
  • Loading branch information
oboukli committed Nov 5, 2023
1 parent 4a2ab2e commit c3a158d
Show file tree
Hide file tree
Showing 23 changed files with 96 additions and 78 deletions.
58 changes: 34 additions & 24 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -65,59 +65,67 @@ AM_LDFLAGS += $(CODE_COVERAGE_LIBS)
endif

bin_PROGRAMS =
include_HEADERS =
lib_LTLIBRARIES =

libtromino_la_SOURCES = src/core/tromino.c
coreincludedir = tromino/core
libtromino_la_SOURCES = \
src/core/tromino.c
libtromino_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-I$(top_srcdir)/include/tromino/core
include_HEADERS += include/tromino/core/tromino.h
coreinclude_HEADERS = \
include/tromino/core/tromino.h
lib_LTLIBRARIES += libtromino.la

libtromino_validation_la_SOURCES = src/validation/validation.c
validationincludedir = tromino/validation
libtromino_validation_la_SOURCES = \
src/validation/validation.c
libtromino_validation_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-I$(top_srcdir)/include/tromino/validation
include_HEADERS += include/tromino/validation/validation.h
validationinclude_HEADERS = \
include/tromino/validation/validation.h
lib_LTLIBRARIES += libtromino-validation.la

cliincludedir = tromino/cli
tromino_SOURCES = \
src/cli/cli_models.hpp \
src/cli/cli_options.cpp \
src/cli/cli_options.hpp \
src/cli/init.cpp \
src/cli/init.hpp \
src/cli/main.cpp \
src/cli/params.hpp \
src/cli/trmn_graph_vt.cpp \
src/cli/trmn_graph_vt.hpp \
src/cli/trmn_graph.hpp \
src/cli/wrapper.cpp \
src/cli/wrapper.hpp
src/cli/wrapper.cpp
tromino_CPPFLAGS = \
$(AM_CPPFLAGS) \
-I$(top_srcdir)/include
-I$(top_srcdir)/include \
-I$(top_srcdir)/include/tromino/cli
tromino_CXXFLAGS = \
$(AM_CXXFLAGS) \
-std=c++20
tromino_LDADD = \
$(top_builddir)/libtromino.la \
$(top_builddir)/libtromino-validation.la
cliinclude_HEADERS = \
include/tromino/cli/cli_models.hpp \
include/tromino/cli/cli_options.hpp \
include/tromino/cli/init.hpp \
include/tromino/cli/params.hpp \
include/tromino/cli/trmn_graph_vt.hpp \
include/tromino/cli/trmn_graph.hpp \
include/tromino/cli/wrapper.hpp
bin_PROGRAMS += tromino

gfx2dincludedir = tromino/gfx2d
libtromino_gfx2d_la_SOURCES = \
src/gfx2d/gfx2d.cpp \
src/gfx2d/view_model.cpp \
src/gfx2d/window.cpp
libtromino_gfx2d_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-I/usr/include/SDL2 \
-I$(top_srcdir)/include/tromino/gfx2d
libtromino_gfx2d_la_LDFLAGS = \
$(AM_LDFLAGS) \
-lSDL2
include_HEADERS += \
gfx2dinclude_HEADERS = \
include/tromino/gfx2d/board.hpp \
include/tromino/gfx2d/gfx2d.hpp \
include/tromino/gfx2d/step.hpp \
Expand All @@ -126,20 +134,16 @@ include_HEADERS += \
include/tromino/gfx2d/window.hpp
lib_LTLIBRARIES += libtromino-gfx2d.la

guiincludedir = tromino/gui
tromino2d_SOURCES = \
src/gui/callback.cpp \
src/gui/callback.hpp \
src/gui/cli_models.hpp \
src/gui/cli_options.cpp \
src/gui/cli_options.hpp \
src/gui/init.cpp \
src/gui/init.hpp \
src/gui/main.cpp \
src/gui/params.hpp
src/gui/main.cpp
tromino2d_CPPFLAGS = \
$(AM_CPPFLAGS) \
-I/usr/include/SDL2 \
-I$(top_srcdir)/include
-I$(top_srcdir)/include \
-I$(top_srcdir)/include/tromino/gui
tromino2d_CXXFLAGS = \
$(AM_CXXFLAGS) \
-std=c++20
Expand All @@ -151,6 +155,12 @@ tromino2d_LDADD = \
$(top_builddir)/libtromino.la \
$(top_builddir)/libtromino-gfx2d.la \
$(top_builddir)/libtromino-validation.la
guiinclude_HEADERS = \
include/tromino/gui/callback.hpp \
include/tromino/gui/cli_models.hpp \
include/tromino/gui/cli_options.hpp \
include/tromino/gui/init.hpp \
include/tromino/gui/params.hpp
bin_PROGRAMS += tromino2d

check_PROGRAMS = libtromino_test
Expand Down
10 changes: 8 additions & 2 deletions emscripten/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,19 @@ $(OBJ_DIR)/core/tromino.o: $(SRC_DIR)/core/tromino.c

$(OBJ_DIR)/wasm/litro/litro.o: $(SRC_DIR)/wasm/litro/litro.c
@mkdir -p $(dir $@)
$(CC) $(CPPFLAGS) $(CFLAGS) \
$(CC) \
$(CPPFLAGS) \
-I $(INC_DIR)/tromino/wasm/litro \
$(CFLAGS) \
-c $< \
-o $@

$(OBJ_DIR)/wasm/trmn/trmn.o: $(SRC_DIR)/wasm/trmn/trmn.cpp
@mkdir -p $(dir $@)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) \
$(CXX) \
$(CPPFLAGS) \
-I $(INC_DIR)/tromino/wasm/trmn \
$(CXXFLAGS) \
-s USE_SDL=2 \
-c $< \
-o $@
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions msbuild/Tromino2d/Tromino2d.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;$(Tromino2dDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(SolutionDir)..\include;$(SolutionDir)..\include\tromino\gfx2d;$(SolutionDir)..\vcpkg\installed\x64-windows\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)..\include;$(SolutionDir)..\include\tromino\gui;$(SolutionDir)..\include\tromino\gfx2d;$(SolutionDir)..\vcpkg\installed\x64-windows\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
Expand All @@ -83,7 +83,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;$(Tromino2dDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(SolutionDir)..\include;$(SolutionDir)..\include\tromino\gfx2d;$(SolutionDir)..\vcpkg\installed\x64-windows\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)..\include;$(SolutionDir)..\include\tromino\gui;$(SolutionDir)..\include\tromino\gfx2d;$(SolutionDir)..\vcpkg\installed\x64-windows\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
Expand All @@ -97,11 +97,11 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\src\gui\callback.hpp" />
<ClInclude Include="..\..\src\gui\cli_models.hpp" />
<ClInclude Include="..\..\src\gui\cli_options.hpp" />
<ClInclude Include="..\..\src\gui\init.hpp" />
<ClInclude Include="..\..\src\gui\params.hpp" />
<ClInclude Include="..\..\include\tromino\gui\callback.hpp" />
<ClInclude Include="..\..\include\tromino\gui\cli_models.hpp" />
<ClInclude Include="..\..\include\tromino\gui\cli_options.hpp" />
<ClInclude Include="..\..\include\tromino\gui\init.hpp" />
<ClInclude Include="..\..\include\tromino\gui\params.hpp" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\gui\callback.cpp" />
Expand Down
10 changes: 5 additions & 5 deletions msbuild/Tromino2d/Tromino2d.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\gui\callback.hpp">
<ClInclude Include="..\..\include\tromino\gui\callback.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\gui\cli_models.hpp">
<ClInclude Include="..\..\include\tromino\gui\cli_models.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\gui\cli_options.hpp">
<ClInclude Include="..\..\include\tromino\gui\cli_options.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\gui\init.hpp">
<ClInclude Include="..\..\include\tromino\gui\init.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\gui\params.hpp">
<ClInclude Include="..\..\include\tromino\gui\params.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
Expand Down
18 changes: 9 additions & 9 deletions msbuild/TrominoCli/TrominoCli.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions);_WINDOWS</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)..\include;$(SolutionDir)..\include\tromino\cli;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
Expand All @@ -86,7 +86,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_WINDOWS</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)..\include;$(SolutionDir)..\include\tromino\cli;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
Expand Down Expand Up @@ -117,13 +117,13 @@
<ClCompile Include="..\..\src\cli\wrapper.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\cli\cli_models.hpp" />
<ClInclude Include="..\..\src\cli\cli_options.hpp" />
<ClInclude Include="..\..\src\cli\init.hpp" />
<ClInclude Include="..\..\src\cli\trmn_graph.hpp" />
<ClInclude Include="..\..\src\cli\trmn_graph_vt.hpp" />
<ClInclude Include="..\..\src\cli\trmn_graph_windows.hpp" />
<ClInclude Include="..\..\src\cli\wrapper.hpp" />
<ClInclude Include="..\..\include\tromino\cli\cli_models.hpp" />
<ClInclude Include="..\..\include\tromino\cli\cli_options.hpp" />
<ClInclude Include="..\..\include\tromino\cli\init.hpp" />
<ClInclude Include="..\..\include\tromino\cli\trmn_graph.hpp" />
<ClInclude Include="..\..\include\tromino\cli\trmn_graph_vt.hpp" />
<ClInclude Include="..\..\include\tromino\cli\trmn_graph_windows.hpp" />
<ClInclude Include="..\..\include\tromino\cli\wrapper.hpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
14 changes: 7 additions & 7 deletions msbuild/TrominoCli/TrominoCli.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,25 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\cli\cli_models.hpp">
<ClInclude Include="..\..\include\tromino\cli\cli_models.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\cli\cli_options.hpp">
<ClInclude Include="..\..\include\tromino\cli\cli_options.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\cli\init.hpp">
<ClInclude Include="..\..\include\tromino\cli\init.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\cli\trmn_graph.hpp">
<ClInclude Include="..\..\include\tromino\cli\trmn_graph.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\cli\trmn_graph_windows.hpp">
<ClInclude Include="..\..\include\tromino\cli\trmn_graph_windows.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\cli\trmn_graph_vt.hpp">
<ClInclude Include="..\..\include\tromino\cli\trmn_graph_vt.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\cli\wrapper.hpp">
<ClInclude Include="..\..\include\tromino\cli\wrapper.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
Expand Down
20 changes: 10 additions & 10 deletions xcode/Tromino2d/Tromino2d.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
75002AC327A684E800CBB593 /* cli_models.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.hpp; path = cli_models.hpp; sourceTree = "<group>"; };
75002AC427A684E900CBB593 /* cli_options.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cli_options.cpp; sourceTree = "<group>"; };
75002AC627A684E900CBB593 /* cli_options.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.hpp; path = cli_options.hpp; sourceTree = "<group>"; };
7503E7C426C892630018B1F2 /* tromino2d */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = tromino2d; sourceTree = BUILT_PRODUCTS_DIR; };
751003472AC8AACE008CCD28 /* uni.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; name = uni.sh; path = scripts/uni.sh; sourceTree = "<group>"; };
75298C282AF050760072728C /* init.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = init.hpp; path = ../../include/tromino/gui/init.hpp; sourceTree = "<group>"; };
75298C292AF050760072728C /* params.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = params.hpp; path = ../../include/tromino/gui/params.hpp; sourceTree = "<group>"; };
75298C2A2AF050760072728C /* cli_options.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = cli_options.hpp; path = ../../include/tromino/gui/cli_options.hpp; sourceTree = "<group>"; };
75298C2B2AF050760072728C /* callback.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = callback.hpp; path = ../../include/tromino/gui/callback.hpp; sourceTree = "<group>"; };
75298C2C2AF050760072728C /* cli_models.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = cli_models.hpp; path = ../../include/tromino/gui/cli_models.hpp; sourceTree = "<group>"; };
752A62C4276FE49F0076CB0C /* init.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = init.cpp; sourceTree = "<group>"; };
752A62C6276FE49F0076CB0C /* init.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.hpp; path = init.hpp; sourceTree = "<group>"; };
7530DEC5280212E800812ABF /* libSDL2-2.0.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libSDL2-2.0.0.dylib"; path = "$(BUILD_DIR)/libSDL2/libSDL2-2.0.0.dylib"; sourceTree = "<group>"; };
755F9D242811CB67004C54E0 /* Config.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = "<group>"; };
758EF491284E51C00069A198 /* libtromino2d.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libtromino2d.a; sourceTree = BUILT_PRODUCTS_DIR; };
758EF497284E535C0069A198 /* libtromino.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libtromino.a; sourceTree = BUILT_PRODUCTS_DIR; };
758EF499284E535C0069A198 /* libtromino-validation.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libtromino-validation.a"; sourceTree = BUILT_PRODUCTS_DIR; };
759EB4162A3267F0000A1BAC /* callback.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.hpp; path = callback.hpp; sourceTree = "<group>"; };
759EB4172A3267F0000A1BAC /* callback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = callback.cpp; sourceTree = "<group>"; };
75ACD98A26DAF724003E33CA /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
75E2E8B927FCAC0800B0525E /* params.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.hpp; path = params.hpp; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -98,15 +98,15 @@
75ACD98926DAF724003E33CA /* gui */ = {
isa = PBXGroup;
children = (
75298C2B2AF050760072728C /* callback.hpp */,
75298C2C2AF050760072728C /* cli_models.hpp */,
75298C2A2AF050760072728C /* cli_options.hpp */,
75298C282AF050760072728C /* init.hpp */,
75298C292AF050760072728C /* params.hpp */,
759EB4172A3267F0000A1BAC /* callback.cpp */,
759EB4162A3267F0000A1BAC /* callback.hpp */,
75002AC327A684E800CBB593 /* cli_models.hpp */,
75002AC427A684E900CBB593 /* cli_options.cpp */,
75002AC627A684E900CBB593 /* cli_options.hpp */,
752A62C4276FE49F0076CB0C /* init.cpp */,
752A62C6276FE49F0076CB0C /* init.hpp */,
75ACD98A26DAF724003E33CA /* main.cpp */,
75E2E8B927FCAC0800B0525E /* params.hpp */,
);
name = gui;
path = ../../src/gui;
Expand Down
Loading

0 comments on commit c3a158d

Please sign in to comment.