Skip to content

Commit

Permalink
fixes in build system
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.code.sf.net/p/instead/code/trunk@824 2984d56d-8eb5-48f3-9f87-270ec957a5b2
  • Loading branch information
Peter Kosyh committed Jun 1, 2010
1 parent 89117aa commit c95f8d1
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include config.make
VERTITLE := instead-$(VERSION)
ARCHIVE := instead_$(VERSION).tar.gz#

SUBDIRS = src/zlib src/sdl-instead stead games themes icon desktop doc languages
SUBDIRS += src/sdl-instead stead games themes icon desktop doc languages

all:
@for dir in $(SUBDIRS); do \
Expand Down
3 changes: 3 additions & 0 deletions Rules.make.standalone
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ DOCPATH=
MANPATH=
SYSTEMSETUP=no

ZLIB_CFLAGS=
ZLIB_LFLAGS=-lz

LUA_CFLAGS=$(shell pkg-config --cflags lua5.1)
LUA_LFLAGS=$(shell pkg-config --libs lua5.1)

Expand Down
3 changes: 3 additions & 0 deletions Rules.make.system
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ LANGPATH=$(STEADPATH)/languages
MANPATH=$(DESTDIR)$(PREFIX)/share/man/man6
SYSTEMSETUP=yes

ZLIB_CFLAGS=
ZLIB_LFLAGS=-lz

LUA_CFLAGS=$(shell pkg-config --cflags lua5.1)
LUA_LFLAGS=$(shell pkg-config --libs lua5.1)

Expand Down
2 changes: 2 additions & 0 deletions Rules.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ DOCPATH=$(DESTDIR)$(PREFIX)doc
LANGPATH=$(DESTDIR)$(PREFIX)languages
MANPATH=$(DESTDIR)$(PREFIX)doc

ZLIB_CFLAGS=-I../zlib
ZLIB_LFLAGS=../zlib/libz.a

LUA_CFLAGS=-I../windows/
LUA_LFLAGS=-llua5.1 -L../windows/
Expand Down
3 changes: 3 additions & 0 deletions Rules.windows
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ GAMESPATH=./games
ICONPATH=./icon
LANGPATH=./languages

ZLIB_CFLAGS=-I../zlib
ZLIB_LFLAGS=../zlib/libz.a

LUA_CFLAGS=
LUA_LFLAGS=-llua5.1

Expand Down
21 changes: 21 additions & 0 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ if ! pkg-config --version >/dev/null 2>&1; then
fi
echo "ok"

echo -n "Checking pkg-config --cflags zlib..."
if ! pkg-config --cflags zlib >/dev/null 2>&1; then
echo "internal"
zlib_cflags=
zlib_libs=
else
echo "system"
zlib_cflags="pkg-config --cflags zlib"
zlib_libs="pkg-config --libs zlib"
fi


echo -n "Checking pkg-config --cflags lua[5.1]..."
if ! pkg-config --cflags lua5.1 >/dev/null 2>&1; then
if ! pkg-config --cflags lua >/dev/null 2>&1; then
Expand All @@ -23,6 +35,7 @@ else
lua_libs="pkg-config --libs lua5.1"
fi


echo -n "Checking sdl-config..."
if ! sdl-config --version >/dev/null 2>&1; then
echo "error: no sdl-config in \$PATH."
Expand Down Expand Up @@ -84,6 +97,14 @@ if ! make clean >/dev/null 2>&1; then
fi
echo -n "Generating config.make..."
echo "# autamatically generated by configure.sh" >config.make
if [[ -z "$zlib_cflags" ]]; then
echo "SUBDIRS=src/zlib" >> config.make
echo "ZLIB_CFLAGS=-I../zlib" >> config.make
echo "ZLIB_LFLAGS=../zlib/libz.a" >> config.make
else
echo "ZLIB_CFLAGS=\$(shell $zlib_cflags)" >> config.make
echo "ZLIB_LFLAGS=\$(shell $zlib_libs)" >> config.make
fi
echo "LUA_CFLAGS=\$(shell $lua_cflags)" >> config.make
echo "LUA_LFLAGS=\$(shell $lua_libs)" >> config.make
echo "SDL_CFLAGS=\$(shell sdl-config --cflags)" >> config.make
Expand Down
6 changes: 3 additions & 3 deletions src/sdl-instead/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
include ../../Rules.make
include ../../config.make

CFLAGS += $(SDL_CFLAGS) $(LUA_CFLAGS) -I../zlib -DLANG_PATH=\"${LANGPATH}/\" -DSTEAD_PATH=\"${STEADPATH}/\" -DGAMES_PATH=\"${GAMESPATH}/\" -DTHEMES_PATH=\"${THEMESPATH}/\" -DVERSION=\"$(VERSION)\" -DICON_PATH=\"${ICONPATH}/\"

LDFLAGS += $(SDL_LFLAGS) $(LUA_LFLAGS) ../zlib/libz.a
CFLAGS += $(SDL_CFLAGS) $(LUA_CFLAGS) $(ZLIB_CFLAGS) -DLANG_PATH=\"${LANGPATH}/\" -DSTEAD_PATH=\"${STEADPATH}/\" -DGAMES_PATH=\"${GAMESPATH}/\" -DTHEMES_PATH=\"${THEMESPATH}/\" -DVERSION=\"$(VERSION)\" -DICON_PATH=\"${ICONPATH}/\"

LDFLAGS += $(SDL_LFLAGS) $(LUA_LFLAGS) $(ZLIB_LFLAGS)

SRC := graphics.c input.c game.c main.c instead.c sound.c SDL_rotozoom.c SDL_anigif.c SDL_gfxBlitFunc.c config.c themes.c menu.c util.c cache.c unzip.c ioapi.c unpack.c $(PLATFORM)

OBJ := $(patsubst %.c, %.o, $(SRC))
Expand Down

0 comments on commit c95f8d1

Please sign in to comment.