forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compiling on linux
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
chi kitory



Joined: 17 Mar 2010
Posts: 28

PostPosted: Sat Mar 20, 2010 1:49 pm    Post subject: Compiling on linux Reply with quote

alright so i made my first c++ Hello world.
Now i have my makefile.
Code:

TARGET = hello
OBJS = main.o

CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Hello World

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak

When i go in terminal and type "make"
i get this
Code:
make: psp-config: Command not found
makefile:12: /lib/build.mak: No such file or directory
make: *** No rule to make target `/lib/build.mak'.  Stop.


what can i do to fix this?

-------------edit 1-------------
Also heres my helloworld file
http://pastebin.com/3sysu2UT
and this is supposed to be a "main.c" right?

-------------edit 2-------------
this wouldnt be such an issue if programmers weren't so into windows. All tutorials that i find are always how to do it in windows and CYGWIN. Which is lame. So thats why this is such a problem.
Also, i have PSPSDK installed no worries.
-------------edit 3-------------
this is my dir for this file:

home/chikitory/psptoolchain/build/pspsdk/src/base/build.mak

i change it to this:
Code:
TARGET = hello
OBJS = main.o

CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Hello World

PSPSDK=$(shell psp-config --pspsdk-path)
include $ home/chikitory/psptoolchain/build/pspsdk/src/base/build.mak

still doesnt work :(
Back to top
View user's profile Send private message
NoEffex



Joined: 27 Nov 2008
Posts: 108

PostPosted: Sat Mar 20, 2010 3:03 pm    Post subject: Reply with quote

The PSPSDK is intended for Linux (And the BSD's AFAIK..basically all but Windows/Dos-based stuff and MacOS)..

I don't think that your path is set.

Make sure that in your startup scripts you have like

export PSPDEV=/whatever/it/is
export PATH=$PATH:$PSPDEV/bin
_________________
Programming with:
Geany + Latest PSPSDK from svn
Back to top
View user's profile Send private message
coyotebean



Joined: 05 Dec 2009
Posts: 26

PostPosted: Sat Mar 20, 2010 5:38 pm    Post subject: Reply with quote

1. PSPSDK could not be set because "psp-config" could not be executed to set the variable. You either missing "psp-config" or PATH is not set properly.

2. Do you mean "/home/..." , it's a big difference.
_________________
GBASP x1, GBM x2, NDSL x2, PSP 100X x3, PSP 200X x5, PSP 300X x3, PSP Go x2, Wii x1
Back to top
View user's profile Send private message
chi kitory



Joined: 17 Mar 2010
Posts: 28

PostPosted: Sun Mar 21, 2010 2:31 pm    Post subject: Reply with quote

i tried /home/bla/bla/etc

ill keep you guys updated.

how do i edit my start up script? ill prob figure it out. but wont hurt to ask

------edit 1-------
is this what you mean?

Code:
gedit ~/.bashrc


Add the following lines at the end of file, save then close.
Code:

export PSPDEV=”/usr/local/pspdev”
export PSPSDK=”$PSPDEV/psp/sdk”
export PATH=”$PATH:$PSPDEV/bin:$PSPSDK/bin”

if soo, it doesnt work :(
Back to top
View user's profile Send private message
chi kitory



Joined: 17 Mar 2010
Posts: 28

PostPosted: Sun Mar 21, 2010 4:59 pm    Post subject: Reply with quote

alright so i looked over this:
http://ps2dev.org/psp/Tools/Toolchain/Installing_the_toolchain_on_Ubuntu

And noticed
source ~/.bashrc

Which when i did it, nothing happened. Meaning my bashrc isnt being installed (so to speak).

I googled the issue and found that source (script) isnt working on the new release of ubuntu (in my case mint). So my question is how do i get source (script) working?
Back to top
View user's profile Send private message
chi kitory



Joined: 17 Mar 2010
Posts: 28

PostPosted: Sun Mar 21, 2010 5:26 pm    Post subject: Reply with quote

Code:
> Does your .bash_profile contain something like:
>
> if [ -f ~/.bashrc ]; then
> . ~/.bashrc
> fi
>


i already did this and added the same to .profile

Not working :(
Back to top
View user's profile Send private message
m0skit0



Joined: 02 Jun 2009
Posts: 226

PostPosted: Mon Mar 22, 2010 5:24 am    Post subject: Reply with quote

Quote:
Which when i did it, nothing happened.

Standard POSIX procedure is not giving any message when process has been succesfully completed. Which means, if nothing happened, then it worked.

To be sure your paths are set, issue an echo $PSPDEV command, same for the other environment paths you're trying to use.

You might also check this noobish script for installing PSPSDK: http://advancedpsp.tk/foro_es/viewtopic.php?f=22&t=154

(I don't mean you're noob, but the script is a noobish one xD)
_________________
The Incredible Bill Gates wrote:
The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
Back to top
View user's profile Send private message
carl0sgs



Joined: 10 Dec 2009
Posts: 41

PostPosted: Mon Mar 22, 2010 8:35 am    Post subject: Reply with quote

This is the file that i use always I need to install the SDK, toolchain and libraries.
Just run all the commands in order (except for the comments with //)
Hope it is useful:

Code:
sudo su

//PSPTOOLCHAIN:

apt-get install autoconf autogen automake1.9 bison gcc make libtool build-essential flex subversion libncurses5-dev patch texinfo wget build-essential autoconf automake bison flex libncurses5-dev doxygen libreadline5-dev libusb-dev texinfo libgmp3-dev libmpfr-dev subversion gcc-4.2 gcc-4.3 libtool

svn co svn://svn.ps2dev.org/psp/trunk

gedit ~/.bashrc

//Add these lines to the end

export PSPDEV=/usr/local/pspdev
export PATH=$PATH:$PSPDEV/bin

source ~/.bashrc

cd trunk/psptoolchain/

./toolchain-sudo.sh

echo 'export PATH="/usr/local/pspdev/bin:$PATH"' >> ~/.bash_profile

//PSPSDK:
cd ../pspsdk/

./bootstrap
./configure
make
make install

//LIBRERIAS:
apt-get install libtool

cd ../psplibraries/

./libraries-sudo.sh
Back to top
View user's profile Send private message Visit poster's website
m0skit0



Joined: 02 Jun 2009
Posts: 226

PostPosted: Mon Mar 22, 2010 8:51 am    Post subject: Reply with quote

It's basically the same as my script xD
_________________
The Incredible Bill Gates wrote:
The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
Back to top
View user's profile Send private message
carl0sgs



Joined: 10 Dec 2009
Posts: 41

PostPosted: Tue Mar 23, 2010 12:40 am    Post subject: Reply with quote

Haha thats probable.
It is just the same anyway you install it xD
Back to top
View user's profile Send private message Visit poster's website
chi kitory



Joined: 17 Mar 2010
Posts: 28

PostPosted: Fri Apr 02, 2010 8:18 am    Post subject: Reply with quote

i did everything you posted completely nothing missed.
and when i do "make" nothing works. :(

Code:
make: psp-config: Command not found
makefile:12: /lib/build.mak: No such file or directory
make: *** No rule to make target `/lib/build.mak'.  Stop.
Back to top
View user's profile Send private message
Alberto



Joined: 12 Feb 2007
Posts: 57
Location: Sofia

PostPosted: Sat Apr 03, 2010 5:08 am    Post subject: Reply with quote

chi kitory wrote:

(...)
Code:
make: psp-config: Command not found


that's your _main_ issue: psp-cofig cannot be found int the path, hence the /lib/build.mak thing (which is supposed to be something like /usr/local/pspdev/.../lib/build.mak)

Look in your installation where psp-config is, and add its folder to the path (inside your ~/.bashrc maybe)

Once you can get this fixed you should have no further issues.

Just my 2c

Cheers, A.
Back to top
View user's profile Send private message
chi kitory



Joined: 17 Mar 2010
Posts: 28

PostPosted: Sun Apr 04, 2010 1:52 pm    Post subject: Reply with quote

any have skype? i can show you my desktop and you can tell me what to do. Cause im not able to figure this :( but im not giving up!
Back to top
View user's profile Send private message
carl0sgs



Joined: 10 Dec 2009
Posts: 41

PostPosted: Sun Apr 04, 2010 11:50 pm    Post subject: Reply with quote

Really easy
just:

sudo make

The toolchain is installed under root, so only root can use it.
I don't know how to use it under not-root... sorry
Back to top
View user's profile Send private message Visit poster's website
chi kitory



Joined: 17 Mar 2010
Posts: 28

PostPosted: Tue Apr 06, 2010 5:01 am    Post subject: Reply with quote

chikitory@Chi-laptop ~/PSPCoding $ sudo make
make: psp-config: Command not found
makefile:12: /lib/build.mak: No such file or directory
make: *** No rule to make target `/lib/build.mak'. Stop.

chikitory@Chi-laptop ~/PSPCoding $ make
make: psp-config: Command not found
makefile:12: /lib/build.mak: No such file or directory
make: *** No rule to make target `/lib/build.mak'. Stop.

Doesnt work both ways...

=================
carl0sgs

can you give me your make file?
Back to top
View user's profile Send private message
carl0sgs



Joined: 10 Dec 2009
Posts: 41

PostPosted: Tue Apr 06, 2010 8:12 am    Post subject: Reply with quote

Here it is:

Code:
TARGET = targetfilename
OBJS = main.o
LIBS =
LIBDIR =
BUILD_PRX = 1
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = HB name
PSPSDK=$(shell psp-config --pspsdk-path)
PSPLIBSDIR = $(PSPSDK)/..
include $(PSPSDK)/lib/build.mak
Back to top
View user's profile Send private message Visit poster's website
chi kitory



Joined: 17 Mar 2010
Posts: 28

PostPosted: Tue Apr 06, 2010 3:04 pm    Post subject: Reply with quote

arg notworking.. but still not giving up..
does it have to with this.

im adding this:
export PSPDEV=/usr/local/pspdev
export PATH=$PATH:$PSPDEV/bin

but when i look at the makefile
i see this:
PSPSDK=$(shell psp-config --pspsdk-path)
PSPLIBSDIR = $(PSPSDK)/..
include $(PSPSDK)/lib/build.mak

should it be PSPDEV or PSPSDK?
are those giving me the issue?
Back to top
View user's profile Send private message
coyotebean



Joined: 05 Dec 2009
Posts: 26

PostPosted: Tue Apr 06, 2010 8:41 pm    Post subject: Reply with quote

chi kitory, how and where did you INSTALL PSPSDK?
_________________
GBASP x1, GBM x2, NDSL x2, PSP 100X x3, PSP 200X x5, PSP 300X x3, PSP Go x2, Wii x1
Back to top
View user's profile Send private message
chi kitory



Joined: 17 Mar 2010
Posts: 28

PostPosted: Tue Apr 06, 2010 9:33 pm    Post subject: Reply with quote

how: carl0sgs's way
Where: Root...
Back to top
View user's profile Send private message
m0skit0



Joined: 02 Jun 2009
Posts: 226

PostPosted: Tue Apr 06, 2010 10:52 pm    Post subject: Reply with quote

Your problem is not on your Makefiles. You should in fact export both PSPDEV and PSPSDK:

Code:
export PSPDEV="/usr/local/pspdev"
export PSPSDK="$PSPDEV/psp/sdk"
export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin

_________________
The Incredible Bill Gates wrote:
The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
Back to top
View user's profile Send private message
chi kitory



Joined: 17 Mar 2010
Posts: 28

PostPosted: Wed Apr 07, 2010 12:05 am    Post subject: Reply with quote

m0skit0 wrote:
Your problem is not on your Makefiles. You should in fact export both PSPDEV and PSPSDK:

Code:
export PSPDEV="/usr/local/pspdev"
export PSPSDK="$PSPDEV/psp/sdk"
export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin


Code:
chikitory@Chi-laptop ~/PSPCoding $ sudo make
[sudo] password for chikitory:
make: psp-config: Command not found
make: psp-config: Command not found
make: psp-config: Command not found
psp-gcc -I. -I/include -O2 -G0 -Wall  -D_PSP_FW_VERSION=150  -L. -L/lib   main.o  -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o targetfilename
make: psp-gcc: Command not found
make: *** [targetfilename] Error 127

Now i get this. looks alot healthier right?[/code]
Back to top
View user's profile Send private message
carl0sgs



Joined: 10 Dec 2009
Posts: 41

PostPosted: Wed Apr 07, 2010 1:56 am    Post subject: Reply with quote

I would download and install everything again.
Back to top
View user's profile Send private message Visit poster's website
chi kitory



Joined: 17 Mar 2010
Posts: 28

PostPosted: Thu Apr 08, 2010 7:18 am    Post subject: Reply with quote

damn iit, i installed this like 5 times already. What do i need to do delete my linux and switch to windows to get dev undergoing?
Back to top
View user's profile Send private message
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Thu Apr 08, 2010 7:43 am    Post subject: Reply with quote

Treat it as a test. If you can't diagnose and fix problems like this then it's going to be seriously tough going programming the PSP on any platform.

Jim
_________________
http://www.dbfinteractive.com
Back to top
View user's profile Send private message Visit poster's website
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Thu Apr 08, 2010 9:41 am    Post subject: Reply with quote

You need to set up your environment variables (those are the export lines) and run make without using sudo because sudo clears out the environment variables before it runs the command.

Try this:
Code:
export PSPDEV="/usr/local/pspdev"
export PSPSDK="$PSPDEV/psp/sdk"
export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin
make
Back to top
View user's profile Send private message Visit poster's website
chi kitory



Joined: 17 Mar 2010
Posts: 28

PostPosted: Thu Apr 08, 2010 11:47 am    Post subject: Reply with quote

Jim im not a idiot. I know Java and Lua like i know how to speak english or korean. Im new to linux, theres a big between Linux and programming...

Code:
chikitory@Chi-laptop ~/PSPCoding $ make
make: *** /usr/local/pspdev/psp/sdk: Is a directory.  Stop.

is what i get now.

----------
i am doing this:
http://advancedpsp.tk/foro_es/viewtopic.php?f=22&t=154

should have done it from the start ill tell you what happens after wards.
even if nothing happens. im not giving up!
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Thu Apr 08, 2010 1:07 pm    Post subject: Reply with quote

It sounds like you've possibly introduced some errors into the makefile. Can you get a fresh copy of what you're trying to compile?
Back to top
View user's profile Send private message Visit poster's website
coyotebean



Joined: 05 Dec 2009
Posts: 26

PostPosted: Thu Apr 08, 2010 3:25 pm    Post subject: Reply with quote

You PSPSDK is not properly installed or environment variables are not properly set.

If you do not get a proper response to command like "psp-gcc", "psp-config" in the prompt, "make" will never work.

"PSPDEV" points to the directory of the development tools. you should see many "psp-xxx" files in the "bin" sub-directory. This "bin" directory should be in your "PATH".

"PSPSDK" points to the sdk libraries. You should see many "pspxxx.h" in the "include" sub-directory, "build.mak" & "build_prx.mak" in the "lib" directory.

Also linux is case-sensitive. "PSPSDK" and "pspsdk" are different in linux.
_________________
GBASP x1, GBM x2, NDSL x2, PSP 100X x3, PSP 200X x5, PSP 300X x3, PSP Go x2, Wii x1
Back to top
View user's profile Send private message
chi kitory



Joined: 17 Mar 2010
Posts: 28

PostPosted: Fri Apr 09, 2010 6:35 am    Post subject: Reply with quote

http://pastebin.com/tWLsQ13g

thats my code im trying to convert...
Back to top
View user's profile Send private message
m0skit0



Joined: 02 Jun 2009
Posts: 226

PostPosted: Fri Apr 09, 2010 10:22 am    Post subject: Reply with quote

And the Makefile, please?
_________________
The Incredible Bill Gates wrote:
The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group