-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update makefiles for easier compiling/installing
- Loading branch information
dborth
committed
Apr 23, 2009
1 parent
eb25849
commit 418eb1b
Showing
6 changed files
with
110 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Directories. | ||
OBJ_DIR := obj/wii | ||
LIB_DIR := lib | ||
BIN_DIR := bin/wii | ||
TEST_OBJ_DIR := $(OBJ_DIR)/test | ||
TEST_SRC_DIR := test | ||
TEST_DOL_DIR := test_dols | ||
|
||
# Tools. | ||
PIPE_TO_SED := 2>&1 | sed "s/:\([0-9]*\):/\(\1\) :/" | ||
|
||
# Test source files. | ||
# It can be useful to switch this variable around to select individual tests which are problematic. | ||
TEST_SRCS := $(wildcard $(TEST_SRC_DIR)/*.c) | ||
#TEST_SRCS := $(TEST_SRC_DIR)/testsprite.c | ||
|
||
# Test object files. | ||
TEST_OBJS := $(subst $(TEST_SRC_DIR)/,$(TEST_OBJ_DIR)/,$(TEST_SRCS:.c=.o)) | ||
|
||
# Test .DOL files. | ||
TEST_DOLS := $(subst $(TEST_OBJ_DIR),$(BIN_DIR),$(TEST_OBJS:.o=.dol)) | ||
|
||
# How to build test files | ||
install: $(TEST_DOLS) | ||
@-mkdir -p ${TEST_DOL_DIR} | ||
cp $(TEST_DOLS) ${TEST_DOL_DIR} | ||
|
||
# How to delete the intermediate files | ||
clean: | ||
@echo Cleaning $(TEST_DOLS) $(TEST_OBJS) | ||
@rm -fr $(TEST_DOLS) $(TEST_OBJS) ${TEST_DOL_DIR} | ||
|
||
# How to build a DOL. | ||
$(BIN_DIR)/%.dol: $(TEST_OBJ_DIR)/%.elf | ||
@echo Creating DOL $@ | ||
@-mkdir -p $(dir $@) | ||
#powerpc-gekko-objcopy -O binary $< $@ | ||
elf2dol $< $@ | ||
@echo ---- | ||
|
||
# Compilation flags. | ||
#COMMON_FLAGS := -g -O2 -mrvl -Wall -mcpu=750 -meabi -mhard-float $(MACHDEP) | ||
COMMON_FLAGS := -g -O2 -mrvl -Wall -mcpu=750 -meabi -mhard-float $(MACHDEP) | ||
INCLUDES := -Iinclude -I$(DEVKITPRO)/libogc/include | ||
#DEFINES := -DGEKKO -DDEBUG_ERROR -DDEBUG_TIMERS -DDEBUG_THREADS -DDEBUG_BUILD -DDEBUG_CONVERT -DSDL_AUDIO_DRIVER_WII | ||
DEFINES := -DGEKKO -DSDL_AUDIO_DRIVER_WII | ||
CFLAGS := $(COMMON_FLAGS) $(INCLUDES) $(DEFINES) | ||
|
||
# Test link flags. | ||
LDFLAGS := $(COMMON_FLAGS) -L$(LIB_DIR) -L$(DEVKITPRO)/libogc/lib/wii -lSDL -lfat -lwiiuse -lbte -logc -lm | ||
|
||
# How to link an ELF. | ||
$(TEST_OBJ_DIR)/%.elf: $(TEST_OBJ_DIR)/%.o $(LIB_DIR)/libSDL.a | ||
@echo Linking $@ | ||
@-mkdir -p $(dir $@) | ||
powerpc-gekko-g++ -o $@ $< $(LDFLAGS) | ||
#keep elf for debugging | ||
#cp $@ /tmp/elf | ||
|
||
# How to compile C file (Tests). | ||
$(TEST_OBJ_DIR)/%.o: $(TEST_SRC_DIR)/%.c | ||
@echo Compiling $< | ||
@-mkdir -p $(dir $@) | ||
powerpc-gekko-gcc $(CFLAGS) -c $< -o $@ $(PIPE_TO_SsED) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters