Guest User

Makefile.msys2

a guest
Aug 19th, 2018
105
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Directories and files
  2. OBJDIR = ../obj/
  3. BINDIR = ../bin/
  4.  
  5. ifeq ($(MSYSTEM),MINGW64)
  6. SRCS_SDL = /mingw64/include/SDL/
  7. SRCS_BOOST = /mingw64/include/boost/
  8. else
  9. SRCS_SDL = /mingw32/include/SDL/
  10. SRCS_BOOST = /mingw32/include/boost/
  11. endif
  12.  
  13. SRCS = $(wildcard *.cpp */*.cpp */*/*.cpp)
  14. OBJS = $(patsubst %.cpp, $(OBJDIR)%.o, $(notdir $(SRCS)))
  15.  
  16. BIN = OpenXcom
  17. PKG-CONFIG = pkg-config
  18.  
  19. # Compiler settings
  20. CXXFLAGS ?= -Og
  21. CXXFLAGS += -Wall -std=gnu++11
  22. CXXFLAGS += -I$(SRCS_BOOST) -I$(SRCS_SDL)
  23.  
  24. LDFLAGS += -Wl,-subsystem,windows
  25.  
  26. LIBS = $(shell $(PKG-CONFIG) --libs sdl yaml-cpp) -lSDL_gfx -lSDL_mixer -lSDL_image -lopengl32 -lshlwapi
  27.  
  28. # Rules
  29. all: $(BINDIR)$(BIN)
  30.  
  31. $(BINDIR)$(BIN): $(OBJS)
  32.     $(CXX) $(OBJS) $(LDFLAGS) $(LIBS) -o $(BINDIR)$(BIN)
  33.  
  34. $(OBJDIR)%.o:: %.cpp
  35.     $(CXX) $(CXXFLAGS) -c -o $@ $<
  36.  
  37. $(OBJDIR)%.o:: Basescape/%.cpp
  38.     $(CXX) $(CXXFLAGS) -c -o $@ $<
  39.  
  40. $(OBJDIR)%.o:: Battlescape/%.cpp
  41.     $(CXX) $(CXXFLAGS) -c -o $@ $<
  42.  
  43. $(OBJDIR)%.o:: Engine/%.cpp
  44.     $(CXX) $(CXXFLAGS) -c -o $@ $<
  45.  
  46. $(OBJDIR)%.o:: Engine/Scalers/%.cpp
  47.     $(CXX) $(CXXFLAGS) -c -o $@ $<
  48.  
  49. $(OBJDIR)%.o:: Engine/Adlib/%.cpp
  50.     $(CXX) $(CXXFLAGS) -c -o $@ $<
  51.  
  52. $(OBJDIR)%.o:: Geoscape/%.cpp
  53.     $(CXX) $(CXXFLAGS) -c -o $@ $<
  54.  
  55. $(OBJDIR)%.o:: Interface/%.cpp
  56.     $(CXX) $(CXXFLAGS) -c -o $@ $<
  57.  
  58. $(OBJDIR)%.o:: Menu/%.cpp
  59.     $(CXX) $(CXXFLAGS) -c -o $@ $<
  60.  
  61. $(OBJDIR)%.o:: Mod/%.cpp
  62.     $(CXX) $(CXXFLAGS) -c -o $@ $<
  63.  
  64. $(OBJDIR)%.o:: Savegame/%.cpp
  65.     $(CXX) $(CXXFLAGS) -c -o $@ $<
  66.  
  67. $(OBJDIR)%.o:: Ufopaedia/%.cpp
  68.     $(CXX) $(CXXFLAGS) -c -o $@ $<
  69.  
  70. clean:
  71.     rm -f $(BINDIR)$(BIN) $(OBJDIR)*.o
  72.  
  73. .PHONY: all clean
RAW Paste Data