summaryrefslogtreecommitdiff
blob: 856670b6a67ecfa3cf14f6cf31d4166a4ae3a5cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Copyright 2014-2016 Alex Xu (Hello71)
# Distributed under the terms of the GNU General Public License v2

PKG_CONFIG ?= pkg-config
PKG_CONFIG_PATH ?= /usr/lib32/pkgconfig:/usr/lib/pkgconfig
PKG_CONFIG := PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG)

SRCS := g_src/basics.cpp g_src/command_line.cpp g_src/enabler.cpp \
	g_src/files.cpp g_src/find_files_posix.cpp g_src/graphics.cpp \
	g_src/init.cpp g_src/interface.cpp g_src/keybindings.cpp \
	g_src/music_and_sound_openal.cpp g_src/random.cpp g_src/textlines.cpp \
	g_src/enabler_input.cpp g_src/KeybindingScreen.cpp \
	g_src/win32_compat.cpp g_src/textures.cpp g_src/resize++.cpp \
	g_src/renderer_offscreen.cpp g_src/ttf_manager.cpp g_src/ViewBase.cpp
OBJS := $(SRCS:.cpp=.o)

BLIBS := ncursesw openal sndfile
LIBS := glew glu gtk+-2.0 sdl SDL_image SDL_ttf zlib
CXXFLAGS ?= -O2 -pipe -Wall -Wextra
CXXFLAGS += -m32 $(shell $(PKG_CONFIG) --cflags $(BLIBS) $(LIBS)) -Dunix -Dlinux -fPIC -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0
LDLIBS := $(shell $(PKG_CONFIG) --libs $(LIBS))

LG := libs/libgraphics.so

all: $(LG)
$(LG): $(OBJS)
	$(LINK.cpp) -shared $^ $(LDLIBS) -o $@

clean:
	$(RM) $(LG) $(OBJS)

.PHONY: clean