Problem compiling multiple files

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Heretic
Posts: 33
Joined: Thu Feb 02, 2006 3:22 pm
Location: Pittsburgh, PA, USA
Contact:

Problem compiling multiple files

Post by Heretic »

Okay so I have 4 .c source files, 3 of which have headers, and I'm trying to compile them all. It has worked perfectly for a long time now (altogether this code has about 40+ hours of work into it), but all of the sudden, when i make the files not all of them are being recompiled (even though I'm changing them drastically). Is there a compiler flag or something I can change to have it always recompile everything? (I know dev cpp has an option like that)
This is the makefile i use if it helps:

Code: Select all

TARGET = Game
OBJS = main.o CalnGFX.o Font.o BreakIn.o

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

LIBDIR =
LIBS = -lpsprtc
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Break_In

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Please remember I'm not very good at all with makefiles (I tried just putting the "rm" command in that didnt work :P )
http://omegagames.netfirms.com -- Support struggling programmers by suffering through their crappy games! (Ok, you don't have to...)
.: Smerity :.
Posts: 9
Joined: Sat Feb 04, 2006 11:43 pm
Contact:

Post by .: Smerity :. »

If you just want to recompile all your source files every time,

make clean; make kxploit

should do it.
Heretic
Posts: 33
Joined: Thu Feb 02, 2006 3:22 pm
Location: Pittsburgh, PA, USA
Contact:

Post by Heretic »

I'm sorry to sound so noobish, (well, actually, I kinda am one...) but how do I include non-psp include files like math.h? I included the file but got an undefined reference... blah... so por favor... gracias. lo siento.
http://omegagames.netfirms.com -- Support struggling programmers by suffering through their crappy games! (Ok, you don't have to...)
HaQue
Posts: 91
Joined: Fri Nov 25, 2005 8:52 am
Location: Adelaide, Australia
Contact:

Post by HaQue »

have a look in C:\cygwin\usr\local\pspdev\psp\include or full path:

C:\cygwin\usr\local\pspdev\psp\include\math.h

hope that helps...
sandberg
Posts: 90
Joined: Wed Oct 05, 2005 1:25 am
Location: Denmark

Post by sandberg »

Heretic wrote:I'm sorry to sound so noobish, (well, actually, I kinda am one...) but how do I include non-psp include files like math.h? I included the file but got an undefined reference... blah... so por favor... gracias. lo siento.
If you include math.h and uses funtionality from that, you also need to link with the math library, otherwise you get undefined references. modify your LIBS variable in your makefile as shown below.

LIBS = -lm -lpsprtc
Br, Sandberg
Heretic
Posts: 33
Joined: Thu Feb 02, 2006 3:22 pm
Location: Pittsburgh, PA, USA
Contact:

Post by Heretic »

that was my problem... with all the psp libs it slike -lpsp + libname, so i tried -lmath and cygwin told me I was retarded :( Thanks!
http://omegagames.netfirms.com -- Support struggling programmers by suffering through their crappy games! (Ok, you don't have to...)
Post Reply