forked from Hydr8gon/NooDS
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.wiiu
61 lines (45 loc) · 1.71 KB
/
Makefile.wiiu
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
ifeq ($(strip $(DEVKITPRO)),)
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>/devkitpro")
endif
include $(DEVKITPRO)/wut/share/wut_rules
NAME := noods
BUILD := build-wiiu
SRCS := src src/common src/console
DATA := src/console/images src/console/shaders
LIBS := -lwut -lSDL2
INCS := $(PORTLIBS) $(WUT_ROOT)
CXXFLAGS := -g -Ofast -flto -ffunction-sections $(MACHDEP) $(INCLUDE) -D__WIIU__ -D__WUT__ -DNO_FDOPEN
LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map)
ifneq ($(BUILD),$(notdir $(CURDIR)))
export LD := $(CXX)
export OUTPUT := $(CURDIR)/$(NAME)
export DEPSDIR := $(CURDIR)/$(BUILD)
export LIBPATHS := $(foreach dir,$(INCS),-L$(dir)/lib)
export VPATH := $(foreach dir,$(SRCS),$(CURDIR)/$(dir)) $(foreach dir,$(DATA),$(CURDIR)/$(dir))
export INCLUDE := $(foreach dir,$(SRCS),-I$(CURDIR)/$(dir)) $(foreach dir,$(INCS),-I$(dir)/include)
CPPFILES := $(foreach dir,$(SRCS),$(notdir $(wildcard $(dir)/*.cpp)))
BMPFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.bmp)))
GSHFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.gsh)))
export OFILES := $(CPPFILES:.cpp=.o) $(BMPFILES:.bmp=.o) $(addsuffix .o,$(GSHFILES))
.PHONY: $(BUILD)
all: $(BUILD)
$(BUILD):
mkdir -p $@
$(MAKE) -C $(BUILD) -f $(CURDIR)/Makefile.wiiu
build-shader:
cd src/console/shaders; ./latte-assembler compile shader_wiiu.gsh --vsh shader_wiiu.vsh --psh shader_wiiu.psh
clean:
rm -rf $(BUILD) $(NAME).rpx $(NAME).elf
else
all: $(OUTPUT).rpx
$(OUTPUT).rpx: $(OUTPUT).elf
$(OUTPUT).elf: $(OFILES)
%.o: %.bmp
@echo $(notdir $<)
@cd ..; $(PREFIX)ld -r -b binary -o $(BUILD)/$@ src/console/images/$*.bmp
%.gsh.o: %.gsh
@echo $(notdir $<)
@$(bin2o)
DEPENDS := $(OFILES:.o=.d)
-include $(DEPENDS)
endif