PageRenderTime 211ms CodeModel.GetById 90ms app.highlight 8ms RepoModel.GetById 66ms app.codeStats 0ms

/Makefile

http://github.com/luciferfran/fail0verflow2
Makefile | 84 lines | 63 code | 20 blank | 1 comment | 1 complexity | 68908513c5e37eb81644d52203c0c6ec MD5 | raw file
 1.SUFFIXES:
 2ifeq ($(strip $(PSL1GHT)),)
 3$(error "PSL1GHT must be set in the environment.")
 4endif
 5
 6include $(PSL1GHT)/Makefile.base
 7
 8TARGET		:=	$(notdir $(CURDIR))
 9BUILD		:=	build
10SOURCE		:=	source
11INCLUDE		:=	include
12DATA		:=	data
13LIBS		:=	 $(PSL1GHT)/modules/spu_soundmodule.bin.a \
14				-lspu_sound -laudioplayer -lmpg123 -logg -laudio -ltiny3d -lgcm_sys -lreality -lsysutil -lio -lpngdec -lsysmodule -lm
15
16ICON0       = $(SOURCE)/../ICON0.PNG
17APPID		:=	PINTOR001
18CONTENTID	:=	UP0001-$(APPID)_00-0000000000000000
19SFOXML		:=	package.xml
20
21CFLAGS		+= -g -O2 -Wall --std=gnu99
22CXXFLAGS	+= -g -O2 -Wall
23
24ifneq ($(BUILD),$(notdir $(CURDIR)))
25
26export OUTPUT	:=	$(CURDIR)/$(TARGET)
27export VPATH	:=	$(foreach dir,$(SOURCE),$(CURDIR)/$(dir)) \
28					$(foreach dir,$(DATA),$(CURDIR)/$(dir))
29export BUILDDIR	:=	$(CURDIR)/$(BUILD)
30export DEPSDIR	:=	$(BUILDDIR)
31
32CFILES		:= $(foreach dir,$(SOURCE),$(notdir $(wildcard $(dir)/*.c)))
33CXXFILES	:= $(foreach dir,$(SOURCE),$(notdir $(wildcard $(dir)/*.cpp)))
34SFILES		:= $(foreach dir,$(SOURCE),$(notdir $(wildcard $(dir)/*.S)))
35BINFILES	:= $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.bin)))
36VCGFILES	:= $(foreach dir,$(SOURCE),$(notdir $(wildcard $(dir)/*.vcg)))
37
38export OFILES	:=	$(CFILES:.c=.o) \
39					$(CXXFILES:.cpp=.o) \
40					$(SFILES:.S=.o) \
41					$(BINFILES:.bin=.bin.o)
42
43export BINFILES	:=	$(BINFILES:.bin=.bin.h)
44export VCGFILES	:=	$(VCGFILES:.vcg=.vcg.h)
45
46export INCLUDES	:=	$(foreach dir,$(INCLUDE),-I$(CURDIR)/$(dir)) \
47					-I$(CURDIR)/$(BUILD) -I$(PSL1GHT)/modules
48
49.PHONY: $(BUILD) clean
50
51$(BUILD):
52	@[ -d $@ ] || mkdir -p $@
53	@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
54
55clean:
56	@echo Clean...
57	@rm -rf $(BUILD) $(OUTPUT).elf $(OUTPUT).self $(OUTPUT).a $(OUTPUT).pkg
58
59pkg: $(BUILD)
60	@echo Creating PKG...
61	@mkdir -p $(BUILD)/pkg
62	@mkdir -p $(BUILD)/pkg/USRDIR
63	@cp $(ICON0) $(BUILD)/pkg/
64	#@$(FSELF) -n $(BUILD)/$(TARGET).elf $(BUILD)/pkg/USRDIR/EBOOT.BIN
65	@$(SELF_NPDRM) $(BUILD)/$(TARGET).elf $(BUILD)/pkg/USRDIR/EBOOT.BIN $(CONTENTID)
66	@$(SFO) -f $(SFOXML) $(BUILD)/pkg/PARAM.SFO
67	@$(PKG) --contentid $(CONTENTID) $(BUILD)/pkg/ $(OUTPUT).pkg
68	@cp $(OUTPUT).pkg $(OUTPUT).geohot.pkg
69	@$(PKG_GEO) $(OUTPUT).geohot.pkg
70
71run: $(BUILD)
72	@$(PS3LOADAPP) $(OUTPUT).self
73
74else
75
76DEPENDS	:= $(OFILES:.o=.d)
77
78$(OUTPUT).self: $(OUTPUT).elf
79$(OUTPUT).elf: $(OFILES)
80$(OFILES): $(BINFILES) $(VCGFILES)
81
82-include $(DEPENDS)
83
84endif