linux makefiles and such (also discussion on a build system)
4 posters
SoulFu Forums II :: Game :: Development
Page 1 of 1
linux makefiles and such (also discussion on a build system)
Someone made this Makefile some time ago, which works quite well
this works pretty good.
put a folder "build" next to the "source" folder and inside that you put a "unix" folder. put the makefile there and run make and - quite magically - a binary will pop up. if you get the sdf file, too, it will run just fine - at least with the code i have here
build system
it would be really great, if we could get a common build system for windows, linux and mac up. i heard good things about cmake, does anyone else have any experience at all? i have almost none (cmake would be especially neat because it can create microsoft visual studio build system whatevers (or so i hear))
- Code:
# Makefile to build SoulFu on *nix systems.
# Hacked for distribution pending a soulfu-compiler fix.
#
# XXX: This is currently somewhat mangled, to match the SoulFu
# build system; Because of the bloat of the tools, we don't
# install them alongside the game.
CC=gcc
BIN=soulfu
SDF=../../sdf/datafile.sdf
CFLAGS=`sdl-config --cflags` -m32
LIBDIRS=
LIBS=`sdl-config --libs` -lSDL_net -lGL -ljpeg -lvorbis -lm
SOURCES=soulfu.c
OBJECTS=$(SOURCES:.c=.o)
INSTALL=install
PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
DATADIR=$(PREFIX)/share/soulfu
DEFINES=-DDATADIR='"$(DATADIR)"'
.PHONY=clean install dist
all: $(BIN) $(SDF)
install: $(BIN) $(SDF)
$(INSTALL) -d $(BINDIR)
$(INSTALL) $(BIN) $(BINDIR)/$(BIN)
$(INSTALL) -d $(DATADIR)
$(INSTALL) $(SDF) $(DATADIR)/datafile.sdf
clean:
rm $(OBJECTS) $(BIN)
$(BIN): $(OBJECTS)
$(CC) $^ -o $@ $(LIBS)
%.o: ../../source/%.c
$(CC) $(CFLAGS) -c $< -o $@ $(DEFINES)
this works pretty good.
put a folder "build" next to the "source" folder and inside that you put a "unix" folder. put the makefile there and run make and - quite magically - a binary will pop up. if you get the sdf file, too, it will run just fine - at least with the code i have here
build system
it would be really great, if we could get a common build system for windows, linux and mac up. i heard good things about cmake, does anyone else have any experience at all? i have almost none (cmake would be especially neat because it can create microsoft visual studio build system whatevers (or so i hear))
timonator- Posts : 6
Join date : 2010-07-25
Re: linux makefiles and such (also discussion on a build system)
Aha, thanks for adding that.
Of course, the old Linux and Mac links were in old forum threads, so we can't snag them anymore, which is inconvenient.
Of course, the old Linux and Mac links were in old forum threads, so we can't snag them anymore, which is inconvenient.
Re: linux makefiles and such (also discussion on a build system)
After putting Makefile inside the build/unix folder, doing `make` or `make all` shows
Looks like the object doesn't get built. What step I may miss so that I can build bin successfully?
Thanks
- Code:
make: *** No rule to make target `soulfu.o', needed by `soulfu'. Stop
Looks like the object doesn't get built. What step I may miss so that I can build bin successfully?
Thanks
shogun1234- Posts : 2
Join date : 2010-08-07
Re: linux makefiles and such (also discussion on a build system)
it's likely that you put the makefile in the wrong folder. that's no problem, though. the folder structure must look like this in order for this makefile to work
+ someplace
+ + sources
+ + + soulfu.c
+ + sdf
+ + + datafile.sdf
+ + build
+ + + unix
+ + + + Makefile
then it oughta work.
If it still won't work, try fiddling with the paths in the Makefile (especially "../../sources" and such). I'm not a proficient Makefilemaker myself, so that's all I know
+ someplace
+ + sources
+ + + soulfu.c
+ + sdf
+ + + datafile.sdf
+ + build
+ + + unix
+ + + + Makefile
then it oughta work.
If it still won't work, try fiddling with the paths in the Makefile (especially "../../sources" and such). I'm not a proficient Makefilemaker myself, so that's all I know
timonator- Posts : 6
Join date : 2010-07-25
Re: linux makefiles and such (also discussion on a build system)
I notice that only
./Branches/Coz/rev4/sdf/datafile.sdf
./Branches/Coz/Trunk/sdf/datafile.sdf
contain datafile.sdf (searched by command `find . -name datafile.sdf`)
There is no datafile.sdf existing within Trunk, Tags folders.
In addition, whilst building using Makefile resided under Branches/Coz/Trunk
it throws message
Is Branches/Coz/Trunk the right place to build the project? Or what (step) I may miss? The revision no. is 141
Thanks.
./Branches/Coz/rev4/sdf/datafile.sdf
./Branches/Coz/Trunk/sdf/datafile.sdf
contain datafile.sdf (searched by command `find . -name datafile.sdf`)
There is no datafile.sdf existing within Trunk, Tags folders.
In addition, whilst building using Makefile resided under Branches/Coz/Trunk
it throws message
- Code:
../../sourcecode/gameseed.c:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘game_seed’
../../sourcecode/gameseed.c: In function ‘generate_game_seed’:
../../sourcecode/gameseed.c:8: error: ‘game_seed’ undeclared (first use in this function)
../../sourcecode/gameseed.c:8: error: (Each undeclared identifier is reported only once
../../sourcecode/gameseed.c:8: error: for each function it appears in.)
make: *** [gameseed.o] Error 1
Is Branches/Coz/Trunk the right place to build the project? Or what (step) I may miss? The revision no. is 141
Thanks.
shogun1234- Posts : 2
Join date : 2010-08-07
Re: linux makefiles and such (also discussion on a build system)
No, the goal is not to find a SVN branch that has an SDF file and then try to compile it It is to find a working version of the source code, and to use the Makefile with it. And to grab the SDF file from somewhere else. Perhaps the source code that comes with the Windows binary installer, and the SDF file that comes with it as well.
Unfortunately, timonator has not specified exactly which source code. Your best bet is to look at forum threads for references to other sources of the source code. There aren't that many here.
Unfortunately, timonator has not specified exactly which source code. Your best bet is to look at forum threads for references to other sources of the source code. There aren't that many here.
donky- Posts : 9
Join date : 2010-08-05
SoulFu Forums II :: Game :: Development
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|