Find file
Fetching contributors…
Cannot retrieve contributors at this time
83 lines (61 sloc) 1.96 KB
.SUFFIXES:
ifeq ($(strip $(PSL1GHT)),)
$(error "PSL1GHT must be set in the environment.")
endif
include $(PSL1GHT)/host/ppu.mk
TARGET := $(notdir $(CURDIR))
BUILD := build
SOURCE := source
INCLUDE := include
DATA := data
LIBS := -ldeadrsx -lnet -lgcm_sys -lreality -lsysutil -lio -lpngdec -lpng -lsysmodule -lz -lm
TITLE := DragonFTP
APPID := DARK0RSX5
CONTENTID := UP0001-$(APPID)_00-0000000000000000
PKGFILES := release
SFOXML := sfo.xml
ICON0 := ICON0.PNG
CFLAGS += -O2 -Wall -std=gnu99
CXXFLAGS += -O2 -Wall
ifneq ($(BUILD),$(notdir $(CURDIR)))
export OUTPUT := $(CURDIR)/$(TARGET)
export VPATH := $(foreach dir,$(SOURCE),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
export BUILDDIR := $(CURDIR)/$(BUILD)
export DEPSDIR := $(BUILDDIR)
CFILES := $(foreach dir,$(SOURCE),$(notdir $(wildcard $(dir)/*.c)))
CXXFILES := $(foreach dir,$(SOURCE),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCE),$(notdir $(wildcard $(dir)/*.S)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.bin)))
VCGFILES := $(foreach dir,$(SOURCE),$(notdir $(wildcard $(dir)/*.vcg)))
ifeq ($(strip $(CXXFILES)),)
export LD := $(CC)
else
export LD := $(CXX)
endif
export OFILES := $(CFILES:.c=.o) \
$(CXXFILES:.cpp=.o) \
$(SFILES:.S=.o) \
$(BINFILES:.bin=.bin.o) \
$(VCGFILES:.vcg=.vcg.o)
export BINFILES := $(BINFILES:.bin=.bin.h)
export VCGFILES := $(VCGFILES:.vcg=.vcg.h)
export INCLUDES := $(foreach dir,$(INCLUDE),-I$(CURDIR)/$(dir)) \
-I$(CURDIR)/$(BUILD)
.PHONY: $(BUILD) clean pkg run
$(BUILD):
@[ -d $@ ] || mkdir -p $@
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
clean:
@echo "[RM] $(notdir $(OUTPUT))"
@rm -rf $(BUILD) $(OUTPUT).elf $(OUTPUT).self $(OUTPUT).a $(OUTPUT)*.pkg
run: $(BUILD)
@$(PS3LOADAPP) $(OUTPUT).self
pkg: $(BUILD) $(OUTPUT).pkg
else
DEPENDS := $(OFILES:.o=.d)
$(OUTPUT).self: $(OUTPUT).elf
$(OUTPUT).elf: $(OFILES)
$(OFILES): $(BINFILES) $(VCGFILES)
-include $(DEPENDS)
endif