diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-07-13 20:38:04 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-07-13 20:38:04 -0400 |
commit | 2190722ac1f0732cf35e7b63572afa698a47789d (patch) | |
tree | 004d2302ece1d9f8feb4d3d435d0393739ebd1bd /Makefile.gc | |
parent | 252e2911383a5267673f00c08419e2afeac35a31 (diff) | |
download | gen3uploader-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.gc | 131 |
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 | #--------------------------------------------------------------------------------- | ||
6 | ifeq ($(strip $(DEVKITPPC)),) | ||
7 | $(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC") | ||
8 | endif | ||
9 | |||
10 | include $(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 | #--------------------------------------------------------------------------------- | ||
18 | TARGET := gen3uploader_gc | ||
19 | BUILD := build | ||
20 | SOURCES := source | ||
21 | DATA := data | ||
22 | INCLUDES := source | ||
23 | |||
24 | #--------------------------------------------------------------------------------- | ||
25 | # options for code generation | ||
26 | #--------------------------------------------------------------------------------- | ||
27 | |||
28 | CFLAGS = -g -O3 -Wall $(MACHDEP) $(INCLUDE) | ||
29 | CXXFLAGS = $(CFLAGS) | ||
30 | |||
31 | LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map | ||
32 | |||
33 | #--------------------------------------------------------------------------------- | ||
34 | # any extra libraries we wish to link with the project | ||
35 | #--------------------------------------------------------------------------------- | ||
36 | LIBS := -logc | ||
37 | |||
38 | |||
39 | #--------------------------------------------------------------------------------- | ||
40 | # list of directories containing libraries, this must be the top level containing | ||
41 | # include and lib | ||
42 | #--------------------------------------------------------------------------------- | ||
43 | LIBDIRS := $(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 | #--------------------------------------------------------------------------------- | ||
49 | ifneq ($(BUILD),$(notdir $(CURDIR))) | ||
50 | #--------------------------------------------------------------------------------- | ||
51 | |||
52 | export OUTPUT := $(CURDIR)/$(TARGET) | ||
53 | |||
54 | export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ | ||
55 | $(foreach dir,$(DATA),$(CURDIR)/$(dir)) | ||
56 | |||
57 | export DEPSDIR := $(CURDIR)/$(BUILD) | ||
58 | |||
59 | #--------------------------------------------------------------------------------- | ||
60 | # automatically build a list of object files for our project | ||
61 | #--------------------------------------------------------------------------------- | ||
62 | CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) | ||
63 | CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) | ||
64 | sFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) | ||
65 | SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S))) | ||
66 | BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) | ||
67 | |||
68 | #--------------------------------------------------------------------------------- | ||
69 | # use CXX for linking C++ projects, CC for standard C | ||
70 | #--------------------------------------------------------------------------------- | ||
71 | ifeq ($(strip $(CPPFILES)),) | ||
72 | export LD := $(CC) | ||
73 | else | ||
74 | export LD := $(CXX) | ||
75 | endif | ||
76 | |||
77 | export 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 | #--------------------------------------------------------------------------------- | ||
84 | export 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 | #--------------------------------------------------------------------------------- | ||
92 | export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \ | ||
93 | -L$(LIBOGC_LIB) | ||
94 | |||
95 | export 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 | #--------------------------------------------------------------------------------- | ||
104 | clean: | ||
105 | @echo clean ... | ||
106 | @rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol | ||
107 | |||
108 | #--------------------------------------------------------------------------------- | ||
109 | else | ||
110 | |||
111 | DEPENDS := $(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 | #--------------------------------------------------------------------------------- | ||
130 | endif | ||
131 | #--------------------------------------------------------------------------------- | ||