Page 1 of 1

make install errors trying to install sapcezero game latest

Posted: Sat Dec 17, 2016 2:28 pm
by Quantu
when i run 'sudo make install' on the game spacezero in /home/pi/spacezero/spacezero it apparently spits out this:
if [ ! -d /usr/local/games ] ; then mkdir -p /usr/local/games ; fi
if [ ! -d /usr/local/share/spacezero ] ; then mkdir -p /usr/local/share/spacezero; fi
if [ ! -d /usr/local/share/spacezero/sounds/ ] ; then mkdir -p /usr/local/share/spacezero/sounds/; fi
if [ ! -d /usr/local/share/spacezero/locales/ ] ; then mkdir -p /usr/local/share/spacezero/locales/; fi
cp ./dat/sounds/*.ogg /usr/local/share/spacezero/sounds/
cp ./dat/letterfrequencytable /usr/local/share/spacezero
cp ./dat/locales/*.txt /usr/local/share/spacezero/locales/
cp ./bin/spacezero /usr/local/games
cp: can not acuire state of ‘./bin/spacezero’ : file or folder does not exist
Makefile:59: recipe for target 'install' failed
make: *** [install] error 1

i translated some stuff of my language to english.

is there a possibility to fix?

Re: make install errors trying to install sapcezero game lat

Posted: Mon Dec 19, 2016 4:20 pm
by topguy

Code: Select all

cp ./bin/spacezero /usr/local/games
cp: can not acuire state of ‘./bin/spacezero’ : file or folder does not exist
If the binary isnt there then you havent built it or it wasnt built correctly ?
Have you done "make" first ?

Re: make install errors trying to install sapcezero game lat

Posted: Sat Dec 24, 2016 12:54 pm
by Quantu
topguy wrote:

Code: Select all

cp ./bin/spacezero /usr/local/games
cp: can not acuire state of ‘./bin/spacezero’ : file or folder does not exist
If the binary isnt there then you havent built it or it wasnt built correctly ?
Have you done "make" first ?
it should run make before it runs install target thats why the sudo make install
or am i completely wrong?

Re: make install errors trying to install sapcezero game lat

Posted: Sat Dec 24, 2016 4:35 pm
by B.Goode

it should run make before it runs install target thats why the sudo make install
or am i completely wrong?
Doesn't that depend entirely on how the maintainer has written the Makefile?

Those sorts of dependencies can be encoded in a Makefile: I'm not sure there is any law that says they must be. (And I can think of good practical reasons why you might want the make and make install to be separate steps.)

What does the maintainer's documentation have to say about installation?

Re: make install errors trying to install sapcezero game lat

Posted: Sun Dec 25, 2016 11:44 am
by Quantu
B.Goode wrote:

it should run make before it runs install target thats why the sudo make install
or am i completely wrong?
Doesn't that depend entirely on how the maintainer has written the Makefile?

Those sorts of dependencies can be encoded in a Makefile: I'm not sure there is any law that says they must be. (And I can think of good practical reasons why you might want the make and make install to be separate steps.)

What does the maintainer's documentation have to say about installation?
this:

SpaceZero v0.86
INSTALLATION

Software Requirements
=================

Libraries to compile SpaceZero:

libgtk2.0-dev
libglib2.0-dev
libopenal-dev
libalut-dev
libvorbis-dev

Compiling and Installing
========================

untar the gzipped file spacezero-X.XX.tar.gz in a temporary file with the
command:

$ tar zxvf spacezero-X.XX.XX.tar.gz

A tree structure directory has been created. Change to the spacezero
directory and simply type:

$make spacezero

and as root:

#make install

for a full system instalation.
The necessary executable file is copied to /usr/local/games.
The necessary data files are copied to /usr/local/share/spacezero.
A config directory is created in your home directory as .spacezero

Add /usr/local/games to your path.

You can change the default target directories in Makefile.

Miscellaneous Notes
===================

gtk 1.2 library
---------------

For old machines you can compile against gtk1.2 library doing:

$make gtk12

instead of $make spacezero


Disclaimer
==========

/*****************************************************************************
** This is part of the SpaceZero program
** Copyright(C) 2006-2013 M.Revenga
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 3), or
** (at your option) any later version, as published by the Free Software
** Foundation.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
******************************************************************************/

Re: make install errors trying to install sapcezero game lat

Posted: Sun Dec 25, 2016 11:50 am
by Quantu
and this is makefile code:

CC=gcc

BINDIR= ./bin
DATADIR= ./dat
SOUNDDIR= $(DATADIR)/sounds
SRCPATH= ./src/

CONFIGDIR=$(HOME)/.spacezero
RECORDFILE=$(CONFIGDIR)/record

# The binary executable will be copied in the next directory.
INSTALL_DIR=/usr/local/games

# All data files will be copied in the next directory.
# tar.gz
INSTALL_DATA_DIR=/usr/local/share/spacezero

# DEB pkg
#INSTALL_DIR=/usr/games
#INSTALL_DATA_DIR=/usr/share/spacezero

SOUNDFLAGS= -lopenal -lalut -lvorbisfile
GTKFLAGS=`pkg-config --cflags gtk+-2.0`
GTKLIBS=`pkg-config --libs gtk+-2.0`

#GTKLIBS12=`gtk-config --cflags`
#GTKFLAGS12=`gtk-config --libs`

CFLAGS= -Wall -O3 --pedantic -I./include -DDATADIR=\"$(DATADIR)\" -DINSTALL_DATA_DIR=\"$(INSTALL_DATA_DIR)\"
LDFLAGS= -lm -lpthread $(SOUNDFLAGS) $(GTKLIBS)

# DEB pkg
#CFLAGS += `dpkg-buildflags --get CFLAGS`
#LDFLAGS += `dpkg-buildflags --get LDFLAGS`

CFLAGS12= -Wall -O3 -I./include -DGTK12 -DDATADIR=\"$(DATADIR)\" -DINSTALL_DATA_DIR=\"$(INSTALL_DATA_DIR)\"
LDFLAGS12= -lm -lpthread $(SOUNDFLAGS) $(GTKLIBS12)

PROGFLAGS=$(CFLAGS) -pg
PROFCC= $(CC) -pg
PROGRAM=$(BINDIR)/spacezero

SOUND_OBJS= $(SRCPATH)sound.o $(SRCPATH)streamsound.o
SOUND_SRCS= $(SRCPATH)sound.c $(SRCPATH)streamsound.c

PROGRAM_OBJS=$(SRCPATH)spacezero.o $(SRCPATH)objects.o $(SRCPATH)ai.o $(SRCPATH)save.o $(SRCPATH)shell.o $(SRCPATH)spacecomm.o $(SRCPATH)help.o $(SRCPATH)comm.o $(SRCPATH)graphics.o $(SRCPATH)functions.o $(SRCPATH)data.o $(SRCPATH)menu.o $(SRCPATH)sectors.o $(SRCPATH)clock.o $(SRCPATH)statistics.o $(SRCPATH)randomnamegen.o $(SRCPATH)locales.o $(SRCPATH)players.o $(SRCPATH)snow.o $(SOUND_OBJS)
PROGRAM_SRCS=$(SRCPATH)spacezero.c $(SRCPATH)objects.c $(SRCPATH)ai.c $(SRCPATH)save.c $(SRCPATH)shell.c $(SRCPATH)spacecomm.c $(SRCPATH)help.c $(SRCPATH)comm.c $(SRCPATH)graphics.c $(SRCPATH)functions.c $(SRCPATH)data.c $(SRCPATH)menu.c $(SRCPATH)sectors.c $(SRCPATH)clock.c $(SRCPATH)statistics.c $(SRCPATH)randomnamegen.c $(SRCPATH)locales.c $(SRCPATH)players.c $(SRCPATH)snow.c $(SOUND_SRCS)


all: dirs spacezero

spacezero: $(PROGRAM_OBJS)
$(CC) $(PROGRAM_OBJS) $(LDFLAGS) $(CFLAGS) -g -o $(PROGRAM)

gtk12: $(PROGRAM_SRCS)
$(CC) `gtk-config --cflags` $(PROGRAM_SRCS) $(LDFLAGS12) $(CFLAGS12) -g -o $(PROGRAM) `gtk-config --libs`

install:
-if [ ! -d $(INSTALL_DIR) ] ; then mkdir -p $(INSTALL_DIR) ; fi
-if [ ! -d $(INSTALL_DATA_DIR) ] ; then mkdir -p $(INSTALL_DATA_DIR); fi
-if [ ! -d $(INSTALL_DATA_DIR)/sounds/ ] ; then mkdir -p $(INSTALL_DATA_DIR)/sounds/; fi
-if [ ! -d $(INSTALL_DATA_DIR)/locales/ ] ; then mkdir -p $(INSTALL_DATA_DIR)/locales/; fi
cp $(SOUNDDIR)/*.ogg $(INSTALL_DATA_DIR)/sounds/
cp $(DATADIR)/letterfrequencytable $(INSTALL_DATA_DIR)
cp $(DATADIR)/locales/*.txt $(INSTALL_DATA_DIR)/locales/
cp $(PROGRAM) $(INSTALL_DIR)
@echo executable files copied to: $(INSTALL_DIR)
@echo data files copied to: $(INSTALL_DATA_DIR)

uninstall:
-rm $(INSTALL_DIR)/spacezero
-if [ -d $(INSTALL_DATA_DIR) ] ; then rm -r $(INSTALL_DATA_DIR); fi

dirs:
-if [ ! -d $(BINDIR) ] ; then mkdir $(BINDIR) ; fi
-if [ ! -d $(CONFIGDIR) ] ; then mkdir $(CONFIGDIR) ; fi
-if [ ! -f $(RECORDFILE) ] ; then touch $(RECORDFILE) ; fi

clean:
rm -f src/*.o bin/spacezero
rm -f core

mrproper: clean
rm -f src/*~ include/*~

.c.o:
$(CC) $(CFLAGS) $(LDFLAGS) $(GTKFLAGS) -c $< -o $@

Re: make install errors trying to install sapcezero game lat

Posted: Sun Dec 25, 2016 12:08 pm
by B.Goode
Change to the spacezero
directory and simply type:

$make spacezero

and as root:

#make install

for a full system instalation.
Seems clear to me. What happens if you try that?

Re: make install errors trying to install sapcezero game lat

Posted: Tue Jan 03, 2017 10:02 am
by Quantu
B.Goode wrote:
Change to the spacezero
directory and simply type:

$make spacezero

and as root:

#make install

for a full system instalation.
Seems clear to me. What happens if you try that?
It says it cant find /bin/spacezero or some
And then recipe for target 'spacezero' failed

Re: make install errors trying to install sapcezero game lat

Posted: Tue Jan 03, 2017 10:41 am
by topguy
And then recipe for target 'spacezero' failed
Then that was the error message this thread should have started with. If you cant build the software, why should the install work.

Code: Select all

make clean
make spacezero

Re: make install errors trying to install sapcezero game lat

Posted: Wed Jan 04, 2017 11:15 am
by B.Goode
Quantu wrote:
B.Goode wrote:
Change to the spacezero
directory and simply type:

$make spacezero

and as root:

#make install

for a full system instalation.
Seems clear to me. What happens if you try that?
It says it cant find /bin/spacezero or some
And then recipe for target 'spacezero' failed
You haven't specified where you got the download. For the purposes of assisting I downloaded the copy linked from http://spacezero.sourceforge.net/

Simply attempting the make spacezero process results in this:

Code: Select all

/usr/bin/ld: ./src/graphics.o: undefined reference to symbol 'XListFonts'
//usr/lib/arm-linux-gnueabihf/libX11.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:53: recipe for target 'spacezero' failed
make: *** [spacezero] Error 1
Using an internet Search tool to lookup that error suggests that the default behaviour of the linker may have changed since the Developer last released the package over 3 years ago.

Adding -lX11 to the LDFLAGS definition in the Makefile fixes this

Code: Select all

LDFLAGS= -lm -lpthread -lX11 $(SOUNDFLAGS) $(GTKLIBS)
(This may not be the best/approved solution, but it works.)

Rebuilding with that version of the Makefile completes without error, and there is now an executable in the bin directory -

Code: Select all

gcc  ./src/spacezero.o ./src/objects.o ./src/ai.o ./src/save.o ./src/shell.o ./src/spacecomm.o ./src/help.o ./src/comm.o ./src/graphics.o  ./src/functions.o ./src/data.o ./src/menu.o ./src/sectors.o ./src/clock.o  ./src/statistics.o ./src/randomnamegen.o ./src/locales.o ./src/players.o ./src/snow.o ./src/sound.o  ./src/streamsound.o   -lm -lpthread -lX11 -lopenal -lalut -lvorbisfile `pkg-config --libs gtk+-2.0`  -Wall -O3 --pedantic -I./include -DDATADIR=\"./dat\" -DINSTALL_DATA_DIR=\"/usr/local/share/spacezero\" -g -o ./bin/spacezero
pi@rpi2b ~/Quantu/spacezero $ ls -al bin
total 376
drwxr-xr-x 2 pi pi   4096 Jan  4 11:02 .
drwxr-xr-x 7 pi pi   4096 Jan  4 10:49 ..
-rwxr-xr-x 1 pi pi 376452 Jan  4 11:02 spacezero
pi@rpi2b ~/Quantu/spacezero $
I have no interest in Games Playing so I have not run the sudo make install step because I don't want this game on my system. But I see no reason why it would no install.

Lessons from this:
1. Developers of free software sometimes adopt a 'Release and Forget' strategy and don't continually adapt their code or instructions for subsequent changes in the environment in which their code runs.

2. Giving the full text of error messages is more helpful than simply saying "it didn't work"