2008-12-31 17:20:47 +01:00
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
# Clear the implicit built in rules
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
.SUFFIXES:
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
ifeq ($(strip $(DEVKITPPC)),)
|
|
|
|
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
|
|
|
|
endif
|
|
|
|
|
|
|
|
include $(DEVKITPPC)/wii_rules
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
# TARGET is the name of the output
|
|
|
|
# BUILD is the directory where object files & intermediate files will be placed
|
|
|
|
# SOURCES is a list of directories containing source code
|
|
|
|
# INCLUDES is a list of directories containing extra header files
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
TARGET := frodo
|
|
|
|
BUILD := build
|
|
|
|
SOURCES := Src
|
|
|
|
DATA := data
|
|
|
|
INCLUDES :=
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
# options for code generation
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
|
2009-01-05 16:33:13 +01:00
|
|
|
PCFLAGS = -DPRECISE_CPU_CYCLES=1 -DPRECISE_CIA_CYCLES=1 -DPC_IS_POINTER=0
|
2009-01-04 15:37:07 +01:00
|
|
|
CFLAGS = -g -Wall $(MACHDEP) $(INCLUDE) -I$(DEVKITPRO)/SDL/include -U__unix -DHAVE_SDL
|
2008-12-31 17:20:47 +01:00
|
|
|
CXXFLAGS = $(CFLAGS)
|
|
|
|
|
|
|
|
LDFLAGS = -L$(DEVKITPRO)/SDL/lib -g $(MACHDEP) -Wl,-Map,$(notdir $@).map
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
# any extra libraries we wish to link with the project
|
|
|
|
#---------------------------------------------------------------------------------
|
2009-01-02 16:07:43 +01:00
|
|
|
LIBS := -lSDL_image -lSDL_ttf -ljpeg -lpng -lz -lSDL -lfreetype -lfat -lwiiuse -lbte -logc -lm
|
2008-12-31 17:20:47 +01:00
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
# list of directories containing libraries, this must be the top level containing
|
|
|
|
# include and lib
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
LIBDIRS :=
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
# no real need to edit anything past this point unless you need to add additional
|
|
|
|
# rules for different file extensions
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
ifneq ($(BUILD),$(notdir $(CURDIR)))
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
export OUTPUT := $(CURDIR)/$(TARGET)
|
|
|
|
|
|
|
|
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
|
|
|
|
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
|
|
|
|
|
|
|
|
export DEPSDIR := $(CURDIR)/$(BUILD)
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
# automatically build a list of object files for our project
|
|
|
|
#---------------------------------------------------------------------------------
|
2009-01-05 10:43:37 +01:00
|
|
|
CFILES := char_to_kc.c gcaudio.c
|
2008-12-31 17:20:47 +01:00
|
|
|
CPPFILES := Display.cpp main.cpp Prefs.cpp SID.cpp REU.cpp IEC.cpp 1541fs.cpp \
|
2009-01-04 16:22:19 +01:00
|
|
|
1541d64.cpp 1541t64.cpp 1541job.cpp SAM.cpp C64.cpp CPUC64.cpp VIC.cpp \
|
2009-01-02 17:40:12 +01:00
|
|
|
CIA.cpp CPU1541.cpp menu.cpp
|
2008-12-31 17:20:47 +01:00
|
|
|
sFILES :=
|
|
|
|
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
|
|
|
|
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
# use CXX for linking C++ projects, CC for standard C
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
ifeq ($(strip $(CPPFILES)),)
|
|
|
|
export LD := $(CC)
|
|
|
|
else
|
|
|
|
export LD := $(CXX)
|
|
|
|
endif
|
|
|
|
|
|
|
|
export OFILES := $(addsuffix .o,$(BINFILES)) \
|
|
|
|
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
|
|
|
|
$(sFILES:.s=.o) $(SFILES:.S=.o)
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
# build a list of include paths
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
export INCLUDE := $(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \
|
|
|
|
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
|
|
|
|
-I$(CURDIR)/$(BUILD) \
|
|
|
|
-I$(LIBOGC_INC)
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
# build a list of library paths
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
|
|
|
|
-L$(LIBOGC_LIB)
|
|
|
|
|
|
|
|
export OUTPUT := $(CURDIR)/$(TARGET)
|
|
|
|
.PHONY: $(BUILD) clean
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
$(BUILD):
|
|
|
|
@[ -d $@ ] || mkdir -p $@
|
|
|
|
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
clean:
|
|
|
|
@echo clean ...
|
2009-01-04 15:37:07 +01:00
|
|
|
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol Src/sysconfig.h Frodo FrodoPC \
|
2009-01-05 16:33:13 +01:00
|
|
|
FrodoSC dist
|
|
|
|
|
|
|
|
dist: $(BUILD)
|
|
|
|
install -d $@/apps/frodo
|
|
|
|
install -d $@/apps/frodo/images
|
|
|
|
install -d $@/apps/frodo/saves
|
|
|
|
cp $(TARGET).dol $@/apps/frodo/boot.dol
|
|
|
|
cp meta.xml $@/apps/frodo/
|
|
|
|
cp icon.png $@/apps/frodo/
|
|
|
|
cp FreeMono.ttf $@/apps/frodo/
|
|
|
|
cp "Kernal ROM" $@/apps/frodo/Kernal_ROM
|
|
|
|
cp "Char ROM" $@/apps/frodo/Char_ROM
|
|
|
|
cp "1541 ROM" $@/apps/frodo/1541_ROM
|
|
|
|
cp "Basic ROM" $@/apps/frodo/Basic_ROM
|
|
|
|
cp frodorc $@/apps/frodo/
|
2008-12-31 17:20:47 +01:00
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
run:
|
|
|
|
wiiload $(TARGET).dol
|
|
|
|
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
else
|
|
|
|
|
|
|
|
DEPENDS := $(OFILES:.o=.d)
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
# main targets
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
$(OUTPUT).dol: $(OUTPUT).elf
|
2008-12-31 18:11:21 +01:00
|
|
|
$(OUTPUT).elf: sysconfig.h $(OFILES)
|
2008-12-31 17:20:47 +01:00
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
# This rule links in binary data with the .jpg extension
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
%.jpg.o : %.jpg
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
@echo $(notdir $<)
|
|
|
|
$(bin2o)
|
|
|
|
|
2008-12-31 18:11:21 +01:00
|
|
|
sysconfig.h: sysconfig.h.Wii
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
Display.cpp: Display_SDL.i
|
|
|
|
|
2008-12-31 17:20:47 +01:00
|
|
|
-include $(DEPENDS)
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
endif
|
|
|
|
#---------------------------------------------------------------------------------
|