Random Homebrew: KFWFlasher
it's a flashing app so there is always a small chance of brickage.

Some Makefile issues

Forum rules
Any post not directly related to programming will be moderated.
Do not request people to code something for you.
Avoid posting messages that do not bring anything to the conversation. We want the threads in this subforum to stay focused.

Some Makefile issues

Postby noname120 » Mon Feb 06, 2012 4:39 pm

Advertising
I'm trying to compile my start of a homebrew but I used to program on pc and there was no need to create makefiles (done by the IDE).

I want to compile two files:
main.cpp with main.h
menu.cpp with menu.h

Of course, I've this at the beginning of main.cpp:
Code: Select all
#include "main.h"
#include "menu.cpp"


and in my menu.cpp:
Code: Select all
#include "menu.h"


I forgot to mention but I use the OSLib.

When I try to compile it, I get the following error:
Image

I'm sure I've menu.h in the same directory.

Can someone help me ?

Is there a tool that build makefile automatically ?

EDIt: My heavily crappy makefile:
Code: Select all
TARGET = BubbleStrugglePSP
OBJS = main.o menu.o

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

LIBDIR =
LDFLAGS =
STDLIBS= -losl -lmikmod -lpng -lz \
      -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lm
LIBS=$(STDLIBS)$(YOURLIBS)

menu.o: menu.cpp menu.h
main.o: main.c main.h
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = A remake of Bubble Struggle 2 on psp
PSP_FW_VERSION = 500

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Last edited by noname120 on Mon Feb 06, 2012 4:45 pm, edited 1 time in total.
I'm evil :twisted:
Image
noname120
 
Posts: 667
Joined: Thu Oct 07, 2010 4:29 pm

Re: Some Makefile issues

Postby JJS » Mon Feb 06, 2012 4:44 pm

Advertising
Your problem is that psp-g++ cannot be found. Did you add the PSPSDK /bin directory to your PATH environment variable?
JJS
Big Beholder
 
Posts: 1516
Joined: Mon Sep 27, 2010 2:18 pm

Re: Some Makefile issues

Postby m0skit0 » Mon Feb 06, 2012 4:46 pm

You have Makefile issues, but you don't show us your Makefile... :roll:

noname120 wrote:#include "menu.cpp"

Never include .cpp files...

PS: also no need hiding your local paths... you just mess the image. And btw, please copy paste the console messages instead of putting a screenshot.
I wanna lots of mov al,0xb
Image
"just not into this RA stuffz"
User avatar
m0skit0
Guru
 
Posts: 4800
Joined: Mon Sep 27, 2010 6:01 pm

Re: Some Makefile issues

Postby noname120 » Mon Feb 06, 2012 4:48 pm

i've not admin rights so I've extracted the install file using universal extractor to get the pspsdk.

Is it possible to compile without admin rights ?
Can I add something to the environment variable without admin rights ?

Never include .cpp files...

Where do I've to precise this in the makefile ?
I'm evil :twisted:
Image
noname120
 
Posts: 667
Joined: Thu Oct 07, 2010 4:29 pm

Re: Some Makefile issues

Postby m0skit0 » Mon Feb 06, 2012 4:50 pm

In Linux you can modify your environment variables without being root (admin), since they're local to the current user. I don't know about Windows... Anyway you can specify the whole path to psp-g++ and get rid of that.
I wanna lots of mov al,0xb
Image
"just not into this RA stuffz"
User avatar
m0skit0
Guru
 
Posts: 4800
Joined: Mon Sep 27, 2010 6:01 pm

Re: Some Makefile issues

Postby JJS » Mon Feb 06, 2012 4:53 pm

You could just write
Code: Select all
set PATH=%PATH%;c:\pspsdk\bin
on the command line. Or specify the full path when calling make. No need to be administrator for any of that. I am pretty sure that a normal user can also modify the user environment variables in the system settings (not the global machine variables though).


Edit: Remove these two lines from your Makefile
Code: Select all
menu.o: menu.cpp menu.h
main.o: main.c main.h
You already specified the necessary files in OBJS.
JJS
Big Beholder
 
Posts: 1516
Joined: Mon Sep 27, 2010 2:18 pm

Re: Some Makefile issues

Postby noname120 » Mon Feb 06, 2012 5:02 pm

Thanks you both, I added the folder of the bin of the pspsdk and typing "path" in the command line show me that the path was correctly added.

I get the same error when trying to do make.

by the way, If I do
Code: Select all
make -f main.cpp

I get the following error : "main.cpp:3: *** Missing separator. Stop"

The third line of my program:
Code: Select all
int initOSLib()
{
}
I'm evil :twisted:
Image
noname120
 
Posts: 667
Joined: Thu Oct 07, 2010 4:29 pm

Re: Some Makefile issues

Postby varun » Tue Feb 07, 2012 5:21 am

i do think that watever is does u have to return saomething in integer as it is

Code: Select all
int function(){}


u should add

Code: Select all
int function(){return 0;} // or anything in integer u want to return


btw, i too dont have admin rights but after many attempts i got a successful tutorial, that did it...the devshelper one
User avatar
varun
Banned
 
Posts: 1059
Joined: Thu Jan 27, 2011 12:32 pm
Location: Mars

Re: Some Makefile issues

Postby m0skit0 » Tue Feb 07, 2012 8:03 am

varun wrote:i do think that watever is does u have to return saomething in integer as it is

The error shown is not that.
I wanna lots of mov al,0xb
Image
"just not into this RA stuffz"
User avatar
m0skit0
Guru
 
Posts: 4800
Joined: Mon Sep 27, 2010 6:01 pm

Re: Some Makefile issues

Postby varun » Tue Feb 07, 2012 8:24 am

ok, but an empty function giving error???
User avatar
varun
Banned
 
Posts: 1059
Joined: Thu Jan 27, 2011 12:32 pm
Location: Mars

Next

Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

Friends

Coding 'n Cracking - Nymphaea - PS3 Forum - darkforestgroup - daxhordes.org - Tgames - coldbird - gopsp.it - pspstation.org - prometheus - hgoel.info - MakeSmartTV - ps vita