Author Topic: HELP: Codeblocks for Nanodesktop for Linux  (Read 3226 times)

Offline pegasus2000

  • Single posting newcomer
  • *
  • Posts: 4
HELP: Codeblocks for Nanodesktop for Linux
« on: October 02, 2008, 07:24:51 pm »

I have a trouble. I was working on a version of Nanodesktop for PSP
that can work on Linux Ubuntu.

The IDE that we have choosen is Code::Blocks.

So the trouble is this.

It is necessary that the system compiles the various .c files
that are in a project, and after it must call a custom makefile
that executes the necessary operations.

I've tried with a custom makefile, but, when I go in the Options
of the Compiler set, in order to set the option Use Makefiles,
the listbox is inhibited and the only option that I can choose
is "Invoke compiler directly" (this option is gray).

You can help me please?

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: HELP: Codeblocks for Nanodesktop for Linux
« Reply #1 on: October 02, 2008, 07:38:02 pm »
Searching the forum for "custom makefile" shows several threads with similar problems.

This is one of them: http://forums.codeblocks.org/index.php/topic,8678.0.html.

If I understood right you want the .c files to be compiled and the makefile called afterwards ?

If that's right you can try to call it as "Post-build step" after compiling the files from within C::B.

Offline pegasus2000

  • Single posting newcomer
  • *
  • Posts: 4
Re: HELP: Codeblocks for Nanodesktop for Linux
« Reply #2 on: October 03, 2008, 08:50:04 am »
Searching the forum for "custom makefile" shows several threads with similar problems.

This is one of them: http://forums.codeblocks.org/index.php/topic,8678.0.html.

If I understood right you want the .c files to be compiled and the makefile called afterwards ?

If that's right you can try to call it as "Post-build step" after compiling the files from within C::B.



Yes, you are right.

I've partially solved the trouble in this way: a file .mak that is called as post-build step.
The trouble now is another.

Please, see this code (it is a MakeFile for Windows Cygwin):



   ## First passage
   
   "$(NDENV_PATH)/PSP/SDK/Tools/ndGenCtor/ndGenCtor.exe" --fake
   "$(NDENV_PATH)/PSP/SDK/PspDev/Bin/psp-gcc" ndpspe_ctor_matrix.c -o ndpspe_ctor_matrix.o $(subst -ansi, ,$(CFLAGS)) -DND_NOT_MAIN_SOURCE
   
   "$(NDENV_PATH)/PSP/SDK/PspDev/Bin/psp-ld" ndpspe_ctor_matrix.o $(OBJ) -o "out" --start-group $(subst -mwindows, ,$(subst -c, ,$(LIBS))) -lgcc --end-group -lndSeed_PSPE -lpspaudio -lpspaudiolib -lpspchnnlsv -lpspctrl -lpspctrl_driver -lpspdisplay -lpspdisplay_driver -lpspfpu -lpspgdb -lpspgdb_kernel -lpspgdb_user -lpspge -lpspgu -lpspgum -lpspgum_vfpu -lpsphprm -lpsphprm_driver -lpspkernel -lpspnand_driver -lpspnet -lpspnet_adhoc -lpspnet_adhocctl -lpspnet_adhocmatching -lpspnet_apctl -lpspnet_inet -lpspnet_resolver -lpsppower -lpsprtc -lpspsdk -lpspsircs -lpspumd -lpspusb -lpspusb_driver -lpspusbbus_driver -lpspusbstor -lpspuser -lpsputility -lpspvfpu -lpspwlan -M -Ttext 8900000 > out.map
   "$(NDENV_PATH)/PSP/SDK/PspDev/Bin/outpatch"

   ## Get the table

   "$(NDENV_PATH)/PSP/SDK/PspDev/Bin/psp-nm" outp > ndpspe_ctor.map
   
   ## Second passage
   
   "$(NDENV_PATH)/PSP/SDK/Tools/ndGenCtor/ndGenCtor.exe"
   "$(NDENV_PATH)/PSP/SDK/PspDev/Bin/psp-gcc" ndpspe_ctor_matrix.c -o ndpspe_ctor_matrix.o $(subst -ansi, ,$(CFLAGS)) -DND_NOT_MAIN_SOURCE
      
   "$(NDENV_PATH)/PSP/SDK/PspDev/Bin/psp-ld" ndpspe_ctor_matrix.o $(OBJ) -o "out" --start-group $(subst -mwindows, ,$(subst -c, ,$(LIBS))) -lgcc --end-group -lndSeed_PSPE -lpspaudio -lpspaudiolib -lpspchnnlsv -lpspctrl -lpspctrl_driver -lpspdisplay -lpspdisplay_driver -lpspfpu -lpspgdb -lpspgdb_kernel -lpspgdb_user -lpspge -lpspgu -lpspgum -lpspgum_vfpu -lpsphprm -lpsphprm_driver -lpspkernel -lpspnand_driver -lpspnet -lpspnet_adhoc -lpspnet_adhocctl -lpspnet_adhocmatching -lpspnet_apctl -lpspnet_inet -lpspnet_resolver -lpsppower -lpsprtc -lpspsdk -lpspsircs -lpspumd -lpspusb -lpspusb_driver -lpspusbbus_driver -lpspusbstor -lpspuser -lpsputility -lpspvfpu -lpspwlan -M -Ttext 8900000 > out.map
   "$(NDENV_PATH)/PSP/SDK/PspDev/Bin/outpatch"

   ## Create the PBP
   
   "$(NDENV_PATH)/PSP/SDK/PspDev/Bin/elf2pbp" outp $(BIN)
   
   "$(NDENV_PATH)/PSP/SDK/PspDev/Bin/unpack-pbp" eboot.pbp
   
   cp "$(NDENV_PATH)/PSP/SDK/ServiceFiles/Nanodesktop_PSPE_Cover.png" "./ICON0.PNG"
   
   "$(NDENV_PATH)/PSP/SDK/PspDev/Bin/pack-pbp" EBOOT_PSPE.PBP PARAM.SFO ICON0.PNG ICON1.PMF UNKNOWN.PNG PIC1.PNG SND0.AT3 UNKNOWN.PSP UNKNOWN.PSAR
   
   rm eboot.pbp
   rm PARAM.SFO
   rm ICON0.PNG
   rm ICON1.PMF
   rm UNKNOWN.PNG
   rm PIC1.PNG
   rm SND0.AT3
   rm UNKNOWN.PSP
   rm UNKNOWN.PSAR
   
   xmkdir -p ./pbp_for_pspe
         
   mv EBOOT_PSPE.PBP ./pbp_for_pspe/EBOOT_PSPE.PBP
   
   ## Cancella i files temporanei CTOR
   
   rm ndpspe_ctor_matrix.c
   rm ndpspe_ctor_matrix.o
   rm ndpspe_ctor.map

   ## Avvia l'emulatore
   
   "$(NDENV_PATH)/PSP/Emulators/PSPE/pspe.exe" ./pbp_for_pspe/EBOOT_PSPE.PBP



I cannot do working this piece of code.

If seems that symbols as $(OBJ) or $(LIBS) don't work. Do you have some ideas ?
Perhaps are the name of the symbols different ?


Offline pegasus2000

  • Single posting newcomer
  • *
  • Posts: 4
Re: HELP: Codeblocks for Nanodesktop for Linux
« Reply #3 on: October 03, 2008, 12:52:41 pm »

There is an update.

I have seen two troubles in the behaviour of Code::Blocks.

a) When the system begins to execute the post-build steps, the echo of the consolle is
disabled, so I cannot see what is the full command line that the system tries to
execute. The trouble remains also if I attempt to set on the option "Full command
line" in Settings/Compiler and debugging/Other options/Compiler logging

b) There is no way to pass to my script (the file .mak that I recall as post-build step)
the list of dirs where the linker must look for the libraries (under Dev-C++, this is
a variable that can be referenced as $(LIBS)). Under Code::Blocks $(LIBS) doesn't
work. I have tried using $libdirs but without result.

Any solution for me ?