mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-22 05:45:38 +00:00
128 lines
3.6 KiB
Makefile
128 lines
3.6 KiB
Makefile
##
|
|
## Supermodel
|
|
## A Sega Model 3 Arcade Emulator.
|
|
## Copyright 2011-2017 Bart Trzynadlowski, Nik Henson, Ian Curtis
|
|
##
|
|
## This file is part of Supermodel.
|
|
##
|
|
## Supermodel is free software: you can redistribute it and/or modify it under
|
|
## the terms of the GNU General Public License as published by the Free
|
|
## Software Foundation, either version 3 of the License, or (at your option)
|
|
## any later version.
|
|
##
|
|
## Supermodel is distributed in the hope that it will be useful, but WITHOUT
|
|
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
## more details.
|
|
##
|
|
## You should have received a copy of the GNU General Public License along
|
|
## with Supermodel. If not, see <http://www.gnu.org/licenses/>.
|
|
##
|
|
|
|
#
|
|
# Makefile.Win32
|
|
#
|
|
# Makefile for Windows systems using gcc and the standard Command Prompt.
|
|
#
|
|
|
|
|
|
###############################################################################
|
|
# Build Options
|
|
###############################################################################
|
|
|
|
#
|
|
# Bitness of build ('32' or '64')
|
|
#
|
|
BITS = 64
|
|
# First check if we're under MSYS2 or not, and then get bitness of CPU
|
|
ifeq ($(strip $(MSYSTEM)),)
|
|
ifeq ($(findstring 64,$(strip $(PROCESSOR_ARCHITECTURE))),)
|
|
BITS = 32
|
|
endif
|
|
else
|
|
ifeq ($(findstring 32,$(strip $(MSYSTEM_CARCH))),32)
|
|
BITS = 32
|
|
endif
|
|
endif
|
|
# Safety check: can be only '32' or '64' otherwise defaults to '64'
|
|
ifneq ($(filter $(strip $(BITS)),32 64),$(strip $(BITS)))
|
|
override BITS = 64
|
|
endif
|
|
|
|
#
|
|
# Use Bash or Windows Prompt shell commands?
|
|
#
|
|
DELETE = rm -d -r -f
|
|
ifeq ($(strip $(MSYSTEM)),)
|
|
DELETE = rmdir /s /q
|
|
endif
|
|
|
|
|
|
###############################################################################
|
|
# Platform Configuration
|
|
#
|
|
# Edit library and include paths as needed.
|
|
###############################################################################
|
|
|
|
#
|
|
# Build environment
|
|
#
|
|
|
|
# Leave empty if 'mingwXX' folder is located on the root filesystem
|
|
MINGW_ROOT =
|
|
|
|
# 'mingw64' or 'mingw32' for respectively 64 or 32 bits builds.
|
|
# MSYS2 uses that scheme, customize it if necessary
|
|
MINGW_BASE = mingw$(strip $(BITS))
|
|
|
|
# The resulting 'mingwXX' base name for includes and libs
|
|
MINGW_DIR = $(strip $(MINGW_ROOT))/$(strip $(MINGW_BASE))
|
|
|
|
#
|
|
# Toolchain
|
|
#
|
|
|
|
CC = gcc
|
|
CXX = g++
|
|
LD = g++
|
|
|
|
#
|
|
# SDL
|
|
#
|
|
#
|
|
# (At least for SDL) The linked libs order is fundamental for a successful compiling!
|
|
# https://stackoverflow.com/questions/24596596/sdl-doesnt-compile-in-native-enviroment
|
|
# http://www.cplusplus.com/forum/beginner/110753/
|
|
#
|
|
|
|
SDL_INCLUDE_DIR = $(MINGW_DIR)/include/SDL
|
|
SDL_LIB_DIR = $(MINGW_DIR)/lib
|
|
SDL_LIBS = -lmingw32 -static-libgcc -static-libstdc++ -lSDLmain -lSDL -liconv -lm -luser32 -lgdi32 -lwinmm -ldxguid
|
|
SDL_CFLAGS = -D_GNU_SOURCE=1 -Dmain=SDL_main
|
|
|
|
#
|
|
# MinGW/Windows-specific
|
|
#
|
|
|
|
PLATFORM_INCLUDE_DIR = $(SDL_INCLUDE_DIR) $(MINGW_DIR)/include
|
|
PLATFORM_LIB_DIR = $(SDL_LIB_DIR)
|
|
PLATFORM_LIBS = -ldinput8 -lglew32 -lglu32 -lole32 -loleaut32 -lopengl32 -lwbemuuid -lws2_32 -lz
|
|
PLATFORM_CFLAGS = $(SDL_CFLAGS) -DSUPERMODEL_WIN32 $(addprefix -I,$(sort $(PLATFORM_INCLUDE_DIR)))
|
|
PLATFORM_LDFLAGS = -static -L$(sort $(PLATFORM_LIB_DIR)) $(SDL_LIBS) $(PLATFORM_LIBS)
|
|
|
|
|
|
###############################################################################
|
|
# Core Makefile
|
|
###############################################################################
|
|
|
|
PLATFORM_SRC_FILES = \
|
|
Src/OSD/Windows/DirectInputSystem.cpp \
|
|
Src/OSD/Windows/WinOutputs.cpp
|
|
|
|
include Makefiles/Makefile.inc
|
|
|
|
clean:
|
|
$(SILENT)echo Cleaning up \"$(BIN_DIR)\" and \"$(OBJ_DIR)\"...
|
|
$(SILENT)$(DELETE) $(BIN_DIR)
|
|
$(SILENT)$(DELETE) $(OBJ_DIR)
|