-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path3ds_rules
78 lines (61 loc) · 2.62 KB
/
3ds_rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
ifeq ($(strip $(DEVKITPRO)),)
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPro)
endif
PORTLIBS := $(DEVKITPRO)/portlibs/3ds
CTRULIB ?= $(DEVKITPRO)/libctru
export PATH := $(DEVKITPRO)/portlibs/3ds/bin:$(PATH)
include $(DEVKITPRO)/devkitARM//base_rules
ifeq ($(strip $(APP_TITLE)),)
APP_TITLE := $(notdir $(OUTPUT))
endif
ifeq ($(strip $(APP_DESCRIPTION)),)
APP_DESCRIPTION := Built with devkitARM & libctru
endif
ifeq ($(strip $(APP_AUTHOR)),)
APP_AUTHOR := Unspecified Author
endif
ifeq ($(strip $(APP_ICON)),)
APP_ICON := $(CTRULIB)/default_icon.png
endif
#---------------------------------------------------------------------------------
%.smdh: $(APP_ICON) $(MAKEFILE_LIST)
$(SILENTCMD)smdhtool --create "$(APP_TITLE)" "$(APP_DESCRIPTION)" "$(APP_AUTHOR)" $(APP_ICON) $@
$(SILENTMSG) built ... $(notdir $@)
#---------------------------------------------------------------------------------
%.3dsx: %.elf
$(SILENTCMD)3dsxtool $< $@ $(_3DSXFLAGS)
$(SILENTMSG) built ... $(notdir $@)
#---------------------------------------------------------------------------------
%.elf:
$(SILENTMSG) linking $(notdir $@)
$(ADD_COMPILE_COMMAND) end
$(SILENTCMD)$(LD) $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@
$(SILENTCMD)$(NM) -CSn $@ > $(notdir $*.lst)
#---------------------------------------------------------------------------------
# rules for assembling GPU shaders
#---------------------------------------------------------------------------------
define shader-as
@$(eval CURBIN := $*.shbin)
@echo "$(CURBIN): $< $1" > $(DEPSDIR)/$(notdir $(CURBIN)).d
$(SILENTCMD)picasso -o $(CURBIN) $1
endef
#---------------------------------------------------------------------------------
%.shbin: %.v.pica %.g.pica
#---------------------------------------------------------------------------------
$(SILENTMSG) $(notdir $^)
$(call shader-as,$^)
#---------------------------------------------------------------------------------
%.shbin : %.v.pica
#---------------------------------------------------------------------------------
$(SILENTMSG) $(notdir $<)
$(call shader-as,$<)
#---------------------------------------------------------------------------------
%.shbin : %.shlist
#---------------------------------------------------------------------------------
$(SILENTMSG) $(notdir $<)
$(call shader-as,$(foreach file,$(shell cat $<),$(dir $<)$(file)))
#---------------------------------------------------------------------------------
%.t3x %.h : %.t3s
#---------------------------------------------------------------------------------
$(SILENTMSG) $(notdir $<)
$(SILENTCMD)tex3ds -i $< -H $*.h -d $*.d -o $*.t3x