remove visual studio files, reorganize source, add gcc makefile
This commit is contained in:
parent
87a60137f1
commit
a95136f7b9
150
Makefile
Normal file
150
Makefile
Normal file
|
@ -0,0 +1,150 @@
|
||||||
|
# this Makefile is based on the ones from devkitPro
|
||||||
|
# TODO: probably should simplify it a bunch (mainly the rules at the bottom)
|
||||||
|
|
||||||
|
TARGET := meshconverter
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
# detect build configuration
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
ifndef ("CFG")
|
||||||
|
CFG=Debug
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ("$(CFG)","Debug")
|
||||||
|
BUILD := Debug
|
||||||
|
endif
|
||||||
|
ifeq ("$(CFG)","Release")
|
||||||
|
BUILD := Release
|
||||||
|
endif
|
||||||
|
ifeq ("$(BUILD)", "")
|
||||||
|
$(error invalid configuration specified via CFG argument)
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(info $(CFG) configuration selected)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
# set up platform specifics
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
UNAME := $(shell uname)
|
||||||
|
|
||||||
|
# default windows libraries and options
|
||||||
|
PLATFORM := win32
|
||||||
|
PLATFORM_LD_FLAGS := -static-libgcc -static-libstdc++
|
||||||
|
|
||||||
|
ifeq ($(UNAME), Linux)
|
||||||
|
# it appears that we're running on linux
|
||||||
|
PLATFORM := linux
|
||||||
|
PLATFORM_LD_FLAGS :=
|
||||||
|
endif
|
||||||
|
|
||||||
|
# TODO: other platform detection
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
ifeq ("$(BUILD)","Debug")
|
||||||
|
DEFINES := -DDEBUG -DDEBUG_ASSERT_BREAK
|
||||||
|
CFLAGS := $(DEFINES) -g -Wall
|
||||||
|
CXXFLAGS := $(CFLAGS)
|
||||||
|
LDFLAGS := $(PLATFORM_LD_FLAGS)
|
||||||
|
LIBS := -g
|
||||||
|
endif
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
ifeq ("$(BUILD)","Release")
|
||||||
|
DEFINES :=
|
||||||
|
CFLAGS := $(DEFINES) -O2 -Wall
|
||||||
|
CXXFLAGS := $(CFLAGS)
|
||||||
|
LDFLAGS := -O2 $(PLATFORM_LD_FLAGS)
|
||||||
|
LIBS :=
|
||||||
|
endif
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
# find sources, setup commands
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
ifneq ($(BUILD),$(notdir $(CURDIR)))
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
SOURCES := ${shell find ./src -type d}
|
||||||
|
export OUTPUT := $(TARGET)
|
||||||
|
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))
|
||||||
|
|
||||||
|
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
|
||||||
|
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
|
||||||
|
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
|
||||||
|
|
||||||
|
export CXX := g++
|
||||||
|
export CC := g++
|
||||||
|
export LD := g++
|
||||||
|
export OFILES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
|
||||||
|
|
||||||
|
.PHONY: $(BUILD) clean
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
$(BUILD):
|
||||||
|
$(info building ...)
|
||||||
|
@[ -d $@ ] || mkdir -p $@
|
||||||
|
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
clean:
|
||||||
|
$(info clean ...)
|
||||||
|
@rm -fr $(BUILD)
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
else
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
# main targets
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
$(OUTPUT): $(OFILES)
|
||||||
|
$(info linking $(notdir $@))
|
||||||
|
$(LD) -o $@ $(LDFLAGS) $(OFILES) $(LIBS)
|
||||||
|
cp $(OUTPUT) ../
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
# build rules by filetype
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
%.a:
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
$(info $(notdir $<))
|
||||||
|
@rm -f $@
|
||||||
|
@$(AR) -rc $@ $^
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
%.o: %.cpp
|
||||||
|
$(info $(notdir $<))
|
||||||
|
@$(CXX) -c $< -o $@ $(CXXFLAGS)
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
%.o: %.c
|
||||||
|
$(info $(notdir $<))
|
||||||
|
@$(CC) -c $< -o $@ $(CFLAGS)
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
%.o: %.s
|
||||||
|
$(info $(notdir $<))
|
||||||
|
@$(CC) -x assembler-with-cpp $(ASFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
%.o: %.S
|
||||||
|
@echo $(notdir $<)
|
||||||
|
@$(CC) -x assembler-with-cpp $(ASFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
endif
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
|
||||||
# Visual Studio 2010
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MeshConverter", "MeshConverter\MeshConverter.vcxproj", "{AADE0387-ED8A-46E2-B2DA-FC521DF7CB9C}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Win32 = Debug|Win32
|
|
||||||
Release|Win32 = Release|Win32
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{AADE0387-ED8A-46E2-B2DA-FC521DF7CB9C}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{AADE0387-ED8A-46E2-B2DA-FC521DF7CB9C}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{AADE0387-ED8A-46E2-B2DA-FC521DF7CB9C}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{AADE0387-ED8A-46E2-B2DA-FC521DF7CB9C}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
|
@ -1,122 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" 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>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<ProjectGuid>{AADE0387-ED8A-46E2-B2DA-FC521DF7CB9C}</ProjectGuid>
|
|
||||||
<Keyword>Win32Proj</Keyword>
|
|
||||||
<RootNamespace>MeshConverter</RootNamespace>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<ImportGroup Label="ExtensionSettings">
|
|
||||||
</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>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<LinkIncremental>true</LinkIncremental>
|
|
||||||
<IncludePath>E:\assimp--2.0.863-sdk\include;$(IncludePath)</IncludePath>
|
|
||||||
<LibraryPath>E:\assimp--2.0.863-sdk\lib\assimp_debug-dll_win32;$(LibraryPath)</LibraryPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<LinkIncremental>false</LinkIncremental>
|
|
||||||
<IncludePath>E:\assimp--2.0.863-sdk\include;$(IncludePath)</IncludePath>
|
|
||||||
<LibraryPath>E:\assimp--2.0.863-sdk\lib\assimp_release-dll_win32;$(LibraryPath)</LibraryPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeader>
|
|
||||||
</PrecompiledHeader>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<Optimization>Disabled</Optimization>
|
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<AdditionalDependencies>assimp.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<PrecompiledHeader>
|
|
||||||
</PrecompiledHeader>
|
|
||||||
<Optimization>MaxSpeed</Optimization>
|
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
|
||||||
<AdditionalDependencies>assimp.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="src\chunks\chunks.cpp" />
|
|
||||||
<ClCompile Include="src\main.cpp" />
|
|
||||||
<ClCompile Include="src\md2\md2.cpp" />
|
|
||||||
<ClCompile Include="src\ms3d\ms3d.cpp" />
|
|
||||||
<ClCompile Include="src\obj\obj.cpp" />
|
|
||||||
<ClCompile Include="src\sm\sm.cpp" />
|
|
||||||
<ClCompile Include="src\util\files.cpp" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClInclude Include="src\assets\animationsequence.h" />
|
|
||||||
<ClInclude Include="src\assets\color.h" />
|
|
||||||
<ClInclude Include="src\assets\material.h" />
|
|
||||||
<ClInclude Include="src\chunks\animations.h" />
|
|
||||||
<ClInclude Include="src\chunks\chunks.h" />
|
|
||||||
<ClInclude Include="src\chunks\keyframes.h" />
|
|
||||||
<ClInclude Include="src\chunks\keyframetriangles.h" />
|
|
||||||
<ClInclude Include="src\chunks\materials.h" />
|
|
||||||
<ClInclude Include="src\chunks\normals.h" />
|
|
||||||
<ClInclude Include="src\chunks\texcoords.h" />
|
|
||||||
<ClInclude Include="src\chunks\triangles.h" />
|
|
||||||
<ClInclude Include="src\chunks\vertices.h" />
|
|
||||||
<ClInclude Include="src\common.h" />
|
|
||||||
<ClInclude Include="src\geometry\common.h" />
|
|
||||||
<ClInclude Include="src\geometry\keyframe.h" />
|
|
||||||
<ClInclude Include="src\geometry\keyframetriangle.h" />
|
|
||||||
<ClInclude Include="src\geometry\matrix4x4.h" />
|
|
||||||
<ClInclude Include="src\geometry\quaternion.h" />
|
|
||||||
<ClInclude Include="src\geometry\triangle.h" />
|
|
||||||
<ClInclude Include="src\geometry\vector2.h" />
|
|
||||||
<ClInclude Include="src\geometry\vector3.h" />
|
|
||||||
<ClInclude Include="src\md2\md2.h" />
|
|
||||||
<ClInclude Include="src\ms3d\ms3d.h" />
|
|
||||||
<ClInclude Include="src\obj\obj.h" />
|
|
||||||
<ClInclude Include="src\sm\sm.h" />
|
|
||||||
<ClInclude Include="src\util\files.h" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
|
||||||
</ImportGroup>
|
|
||||||
</Project>
|
|
Reference in a new issue