View unanswered posts | View active topics It is currently Sat Sep 22, 2018 5:37 pm



Reply to topic  [ 2 posts ] 
 Changing makefile to keep .o files out of src folder 
Author Message

Joined: Sat Feb 06, 2010 11:10 am
Posts: 9
I'm trying to figure out how to change my PSP makefile to put its .o files in a "build" folder instead of dumping them all in my "src" folder. Here's my folder structure:

Code:
 - makefile
 - src
   - test.c
 - include
   - test.h


Here's what I'm trying to produce:

Code:
 - makefile
 - src
   - test.c
 - include
   - test.h
 - build
   - test.o


Here's what I currently end up with:

Code:
 - makefile
 - src
   - test.c
   - test.o
 - include
   - test.h


Makefiles really aren't my thing. Any suggestions?

Here's my current makefile:

Code:
TARGET_LIB   :=   test.a
LIBDIR      :=   
INCDIR      :=   include
SRCDIR      :=   src

BUILD      := build

CFILES      := $(foreach dir,$(SRCDIR),$(notdir $(wildcard $(dir)/*.c)))

OBJS       := $(addprefix $(SRCDIR)/,$(CFILES:%.c=%.o))
#OBJS       := $(CFILES:%.c=%.o)

CFLAGS      = -O2 -G0 -Wall -std=gnu99 -DTARGET_PSP -Wno-unknown-pragmas -I.
CXXFLAGS   = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS      = $(CFLAGS)

LDFLAGS      =

LIBS      = -lm

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


Sun Feb 25, 2018 6:39 pm
Profile

Joined: Sun Feb 25, 2018 6:36 am
Posts: 3
I'm very sorry I can't help but I just want to say I'm glad there are still people out there who use the pspdev kits. :shock: :D :lol:

As a side note, maybe could try adding a path to the make?
EG OBJS = src\make.o? :cry:


Mon Feb 26, 2018 12:07 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
  Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.
Get devkitPro at SourceForge.net. Fast, secure and Free Open Source software downloads