about summary refs log tree commit diff stats
path: root/Makefile.gc
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-07-13 20:38:04 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-07-13 20:38:04 -0400
commit2190722ac1f0732cf35e7b63572afa698a47789d (patch)
tree004d2302ece1d9f8feb4d3d435d0393739ebd1bd /Makefile.gc
parent252e2911383a5267673f00c08419e2afeac35a31 (diff)
downloadgen3uploader-2190722ac1f0732cf35e7b63572afa698a47789d.tar.gz
gen3uploader-2190722ac1f0732cf35e7b63572afa698a47789d.tar.bz2
gen3uploader-2190722ac1f0732cf35e7b63572afa698a47789d.zip
Organized code more
Now the link-specific stuff is abstracted into its own file, and the
code for negotiating the "different" multiboot protocol is in its own
file. Also, removed support for compiling for GC because eventually we
will be using Wii-only features. Also put the main extractor code into a
thread so that we can monitor for the user pressing the start button to
exit.
Diffstat (limited to 'Makefile.gc')
-rw-r--r--Makefile.gc131
1 files changed, 0 insertions, 131 deletions
diff --git a/Makefile.gc b/Makefile.gc deleted file mode 100644 index eaaf3b9..0000000 --- a/Makefile.gc +++ /dev/null
@@ -1,131 +0,0 @@
1#---------------------------------------------------------------------------------
2# Clear the implicit built in rules
3#---------------------------------------------------------------------------------
4.SUFFIXES:
5#---------------------------------------------------------------------------------
6ifeq ($(strip $(DEVKITPPC)),)
7$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
8endif
9
10include $(DEVKITPPC)/gamecube_rules
11
12#---------------------------------------------------------------------------------
13# TARGET is the name of the output
14# BUILD is the directory where object files & intermediate files will be placed
15# SOURCES is a list of directories containing source code
16# INCLUDES is a list of directories containing extra header files
17#---------------------------------------------------------------------------------
18TARGET := gen3uploader_gc
19BUILD := build
20SOURCES := source
21DATA := data
22INCLUDES := source
23
24#---------------------------------------------------------------------------------
25# options for code generation
26#---------------------------------------------------------------------------------
27
28CFLAGS = -g -O3 -Wall $(MACHDEP) $(INCLUDE)
29CXXFLAGS = $(CFLAGS)
30
31LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map
32
33#---------------------------------------------------------------------------------
34# any extra libraries we wish to link with the project
35#---------------------------------------------------------------------------------
36LIBS := -logc
37
38
39#---------------------------------------------------------------------------------
40# list of directories containing libraries, this must be the top level containing
41# include and lib
42#---------------------------------------------------------------------------------
43LIBDIRS := $(DEVKITPPC)/lib $(CURDIR)
44
45#---------------------------------------------------------------------------------
46# no real need to edit anything past this point unless you need to add additional
47# rules for different file extensions
48#---------------------------------------------------------------------------------
49ifneq ($(BUILD),$(notdir $(CURDIR)))
50#---------------------------------------------------------------------------------
51
52export OUTPUT := $(CURDIR)/$(TARGET)
53
54export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
55 $(foreach dir,$(DATA),$(CURDIR)/$(dir))
56
57export DEPSDIR := $(CURDIR)/$(BUILD)
58
59#---------------------------------------------------------------------------------
60# automatically build a list of object files for our project
61#---------------------------------------------------------------------------------
62CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
63CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
64sFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
65SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
66BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
67
68#---------------------------------------------------------------------------------
69# use CXX for linking C++ projects, CC for standard C
70#---------------------------------------------------------------------------------
71ifeq ($(strip $(CPPFILES)),)
72 export LD := $(CC)
73else
74 export LD := $(CXX)
75endif
76
77export OFILES := $(addsuffix .o,$(BINFILES)) \
78 $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
79 $(sFILES:.s=.o) $(SFILES:.S=.o)
80
81#---------------------------------------------------------------------------------
82# build a list of include paths
83#---------------------------------------------------------------------------------
84export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
85 $(foreach dir,$(LIBDIRS),-I$(dir)/include) \
86 -I$(CURDIR)/$(BUILD) \
87 -I$(LIBOGC_INC)
88
89#---------------------------------------------------------------------------------
90# build a list of library paths
91#---------------------------------------------------------------------------------
92export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
93 -L$(LIBOGC_LIB)
94
95export OUTPUT := $(CURDIR)/$(TARGET)
96.PHONY: $(BUILD) clean
97
98#---------------------------------------------------------------------------------
99$(BUILD):
100 @[ -d $@ ] || mkdir -p $@
101 @make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.gc
102
103#---------------------------------------------------------------------------------
104clean:
105 @echo clean ...
106 @rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol
107
108#---------------------------------------------------------------------------------
109else
110
111DEPENDS := $(OFILES:.o=.d)
112
113#---------------------------------------------------------------------------------
114# main targets
115#---------------------------------------------------------------------------------
116$(OUTPUT).dol: $(OUTPUT).elf
117$(OUTPUT).elf: $(OFILES)
118
119#---------------------------------------------------------------------------------
120# This rule links in binary data with the .jpg extension
121#---------------------------------------------------------------------------------
122%.gba.o : %.gba
123#---------------------------------------------------------------------------------
124 @echo $(notdir $<)
125 $(bin2o)
126
127-include $(DEPENDS)
128
129#---------------------------------------------------------------------------------
130endif
131#---------------------------------------------------------------------------------