Skip to content

Commit

Permalink
Merge pull request #2 from MisfitMaid/linux-tiles-build
Browse files Browse the repository at this point in the history
also bring in the makefile changes
  • Loading branch information
sylae authored Jul 20, 2024
2 parents 46e5037 + 8209c48 commit 29e919e
Showing 1 changed file with 33 additions and 31 deletions.
64 changes: 33 additions & 31 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -717,33 +717,6 @@ endif

PKG_CONFIG = $(CROSS)pkg-config

ifeq ($(SOUND), 1)
ifneq ($(TILES),1)
$(error "SOUND=1 only works with TILES=1")
endif
ifeq ($(NATIVE),osx)
ifndef FRAMEWORK # libsdl build
ifeq ($(MACPORTS), 1)
LDFLAGS += -lSDL2_mixer -lvorbisfile -lvorbis -logg
else # homebrew
CXXFLAGS += $(shell $(PKG_CONFIG) --cflags SDL2_mixer)
LDFLAGS += $(shell $(PKG_CONFIG) --libs SDL2_mixer)
LDFLAGS += -lvorbisfile -lvorbis -logg
endif
endif
else # not osx
CXXFLAGS += $(shell $(PKG_CONFIG) --cflags SDL2_mixer)
LDFLAGS += $(shell $(PKG_CONFIG) --libs SDL2_mixer)
LDFLAGS += -lpthread
endif

ifeq ($(MSYS2),1)
LDFLAGS += -lmpg123 -lshlwapi -lvorbisfile -lvorbis -logg -lflac
endif

CXXFLAGS += -DSDL_SOUND
endif

ifeq ($(SDL), 1)
TILES = 1
endif
Expand Down Expand Up @@ -778,7 +751,8 @@ ifeq ($(TILES), 1)
endif
endif
else ifneq ($(NATIVE),emscripten)
CXXFLAGS += $(shell $(PKG_CONFIG) --cflags sdl2 SDL2_image SDL2_ttf)
CXXFLAGS += $(shell $(PKG_CONFIG) --cflags sdl2)
CXXFLAGS += $(shell $(PKG_CONFIG) --cflags SDL2_image SDL2_ttf)

ifeq ($(STATIC), 1)
LDFLAGS += $(shell $(PKG_CONFIG) sdl2 --static --libs)
Expand All @@ -788,9 +762,6 @@ ifeq ($(TILES), 1)

LDFLAGS += -lSDL2_ttf -lSDL2_image

# We don't use SDL_main -- we have proper main()/WinMain()
CXXFLAGS := $(filter-out -Dmain=SDL_main,$(CXXFLAGS))
LDFLAGS := $(filter-out -lSDL2main,$(LDFLAGS))
endif

DEFINES += -DTILES
Expand Down Expand Up @@ -860,6 +831,37 @@ else
endif
endif # TILES

ifeq ($(SOUND), 1)
ifneq ($(TILES),1)
$(error "SOUND=1 only works with TILES=1")
endif
ifeq ($(NATIVE),osx)
ifndef FRAMEWORK # libsdl build
ifeq ($(MACPORTS), 1)
LDFLAGS += -lSDL2_mixer -lvorbisfile -lvorbis -logg
else # homebrew
CXXFLAGS += $(shell $(PKG_CONFIG) --cflags SDL2_mixer)
LDFLAGS += $(shell $(PKG_CONFIG) --libs SDL2_mixer)
LDFLAGS += -lvorbisfile -lvorbis -logg
endif
endif
else # not osx
CXXFLAGS += $(shell $(PKG_CONFIG) --cflags SDL2_mixer)
LDFLAGS += $(shell $(PKG_CONFIG) --libs SDL2_mixer)
LDFLAGS += -lpthread
endif

ifeq ($(MSYS2),1)
LDFLAGS += -lmpg123 -lshlwapi -lvorbisfile -lvorbis -logg -lflac
endif

CXXFLAGS += -DSDL_SOUND
endif

# We don't use SDL_main -- we have proper main()/WinMain()
CXXFLAGS := $(filter-out -Dmain=SDL_main,$(CXXFLAGS))
LDFLAGS := $(filter-out -lSDL2main,$(LDFLAGS))

ifeq ($(BSD), 1)
# BSDs have backtrace() and friends in a separate library
ifeq ($(BACKTRACE), 1)
Expand Down

0 comments on commit 29e919e

Please sign in to comment.