- cleanup makefiles

This commit is contained in:
SoftCoder 2017-09-25 18:55:35 -07:00
parent d8073423a7
commit 97a89d0bb0
4 changed files with 18 additions and 21 deletions

View File

@ -7,7 +7,7 @@ $(error STEAMWORKS is not set)
endif endif
CXX ?= clang++ CXX ?= clang++
WINDRES ?= windres # WINDRES ?= windres
HOST ?= linux64 HOST ?= linux64
FLAGS := -I$(STEAMWORKS)/public -DGAME_LAUNCH_NAME=\"$(GAME_LAUNCH_NAME)\" -Wall FLAGS := -I$(STEAMWORKS)/public -DGAME_LAUNCH_NAME=\"$(GAME_LAUNCH_NAME)\" -Wall
@ -30,20 +30,22 @@ else ifeq ($(HOST),w32)
endif endif
SRC := steamshim_parent.cpp SRC := steamshim_parent.cpp
RES := resources.rc # RES := resources.rc
RESOBJ := resources.o # RESOBJ := resources.o
ifeq ($(HOST),w32) ifeq ($(HOST),w32)
$(TARGET).exe: $(SRC) $(RESOBJ) # $(TARGET).exe: $(SRC) $(RESOBJ)
$(TARGET).exe: $(SRC)
$(CXX) $^ -o $@ $(FLAGS) $(CXX) $^ -o $@ $(FLAGS)
$(RESOBJ): $(RES) # $(RESOBJ): $(RES)
$(WINDRES) $< $@ # $(WINDRES) $< $@
else else
$(TARGET): $(SRC) $(TARGET): $(SRC)
$(CXX) $^ -o $@ $(FLAGS) $(CXX) $^ -o $@ $(FLAGS)
endif endif
clean: clean:
rm -f $(TARGET) $(TARGET).exe $(RESOBJ) # rm -f $(TARGET) $(TARGET).exe $(RESOBJ)
rm -f $(TARGET) $(TARGET).exe
.PHONY: clean .PHONY: clean

View File

@ -1,13 +1,12 @@
TARGET = megaglest_shim TARGET = megaglest_shim
GAME_LAUNCH_NAME = megaglest.exe GAME_LAUNCH_NAME = megaglest
!ifndef STEAMWORKS !ifndef STEAMWORKS
# STEAMWORKS = /home/softcoder/Code/steamworks_sdk/sdk # STEAMWORKS = ..\..\..\steamworks_sdk\sdk
!error STEAMWORKS is not set !error STEAMWORKS is not set
!endif !endif
# CXX = cl.exe /O2 /DNDEBUG # CXX = cl.exe /O2 /DNDEBUG
# WINDRES = windres
LNK = link.exe LNK = link.exe
FLAGS = /I $(STEAMWORKS)\public -DGAME_LAUNCH_NAME=\"$(GAME_LAUNCH_NAME)\" FLAGS = /I $(STEAMWORKS)\public -DGAME_LAUNCH_NAME=\"$(GAME_LAUNCH_NAME)\"
# LIB_PATH = "/LIBPATH:$(STEAMWORKS)\redistributable_bin" /VERBOSE:LIB # LIB_PATH = "/LIBPATH:$(STEAMWORKS)\redistributable_bin" /VERBOSE:LIB
@ -16,12 +15,8 @@ LIBS = steam_api.lib gdi32.lib user32.lib
!if "$(DEBUG)" == "1" !if "$(DEBUG)" == "1"
FLAGS = $(FLAGS) -DSTEAMSHIM_DEBUG FLAGS = $(FLAGS) -DSTEAMSHIM_DEBUG
!else
FLAGS = $(FLAGS) -mwindows
!endif !endif
SRC = steamshim_parent.cpp
.PHONY : clean all .PHONY : clean all
all : app all : app
@ -32,5 +27,5 @@ steamshim_parent.obj: steamshim_parent.cpp
$(CXX) /MT $(CXXFLAGS) $(FLAGS) /c steamshim_parent.cpp /Fosteamshim_parent.obj $(CXX) /MT $(CXXFLAGS) $(FLAGS) /c steamshim_parent.cpp /Fosteamshim_parent.obj
clean: clean:
@-erase $(TARGET).obj @-erase steamshim_parent.obj
@-erase $(TARGET).exe @-erase $(TARGET).exe

View File

@ -3,7 +3,6 @@
rem change to the directory of this batch file rem change to the directory of this batch file
rem SET VCVARS_PLATFORM=x86_amd64 rem SET VCVARS_PLATFORM=x86_amd64
SET VCVARS_PLATFORM= SET VCVARS_PLATFORM=
SET MSBUILD_CONFIG=Release SET MSBUILD_CONFIG=Release
ECHO -------------------------------- ECHO --------------------------------
@ -53,8 +52,8 @@ ECHO --------------------------------
Echo Building MegaGlest using Visual Studio 2015... Echo Building MegaGlest using Visual Studio 2015...
set CL=/MP set CL=/MP
del steamshim_parent.obj IF EXIST "steamshim_parent.obj" del steamshim_parent.obj
del megaglest_shim.exe IF EXIST "megaglest_shim.exe" del megaglest_shim.exe
rem set VisualStudioVersion=11.0 rem set VisualStudioVersion=11.0
set msBuildMaxCPU= set msBuildMaxCPU=
@ -68,7 +67,7 @@ ECHO Found CPU Count [%NUMBER_OF_PROCESSORS%]
SET MSBUILD_PATH_MG_x64="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V140\\" SET MSBUILD_PATH_MG_x64="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V140\\"
echo Doing a FULL REBUILD... echo Doing a FULL REBUILD...
nmake /f Makefile.win STEAMWORKS=c:\Code\steamworks_sdk\sdk nmake /f Makefile.win STEAMWORKS=..\..\..\steamworks_sdk\sdk
ECHO ... End. ECHO ... End.
rem pause execution so we can see the output before the batch file exits rem pause execution so we can see the output before the batch file exits

View File

@ -1,10 +1,11 @@
#!/bin/bash #!/bin/bash
# Use this script to build MegaGlest using cmake # Use this script to build MegaGlest Steam Shim using make
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com> # Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
# Copyright (c) 2011-2013 Mark Vejvoda under GNU GPL v3.0+ # Copyright (c) 2011-2013 Mark Vejvoda under GNU GPL v3.0+
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
rm steamshim rm megaglest_shim
rm megaglest
#make STEAMWORKS?=/home/softcoder/Code/steamworks_sdk/sdk #make STEAMWORKS?=/home/softcoder/Code/steamworks_sdk/sdk
make $@ make $@