| 1 |
|
| 2 |
.SUFFIXES: |
| 3 |
|
| 4 |
|
| 5 |
ifeq ($(strip $(DEVKITARM)),) |
| 6 |
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM") |
| 7 |
endif |
| 8 |
|
| 9 |
include $(DEVKITARM)/ds_rules |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
TARGET := powder |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
LIBS := -lfat -lnds9 |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
LIBDIRS := $(LIBNDS) |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
ARCH := -mthumb -mthumb-interwork |
| 34 |
|
| 35 |
INCLUDE := -I$(LIBNDS)/include -I$(CURDIR) |
| 36 |
|
| 37 |
LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) |
| 38 |
|
| 39 |
CFLAGS := -g -Wall -O1\ |
| 40 |
-march=armv5te -mtune=arm946e-s -fomit-frame-pointer\ |
| 41 |
-ffast-math -fno-short-enums \ |
| 42 |
$(ARCH) |
| 43 |
|
| 44 |
CFLAGS += $(INCLUDE) -DARM9 -DUSING_DS |
| 45 |
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions |
| 46 |
|
| 47 |
ASFLAGS := -g $(ARCH) |
| 48 |
LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -mno-fpu -Wl,-Map,$(notdir $*.map) |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
OUTPUT := $(CURDIR)/$(TARGET) |
| 58 |
|
| 59 |
VPATH := |
| 60 |
|
| 61 |
DEPSDIR := $(CURDIR) |
| 62 |
|
| 63 |
CFILES := |
| 64 |
CPPFILES := dsmain.cpp \ |
| 65 |
hamfake.cpp \ |
| 66 |
../../action.cpp \ |
| 67 |
../../assert.cpp \ |
| 68 |
../../ai.cpp \ |
| 69 |
../../artifact.cpp \ |
| 70 |
../../bmp.cpp \ |
| 71 |
../../build.cpp \ |
| 72 |
../../buf.cpp \ |
| 73 |
../../control.cpp \ |
| 74 |
../../creature.cpp \ |
| 75 |
../../dpdf_table.cpp \ |
| 76 |
../../encyc_support.cpp \ |
| 77 |
../../gfxengine.cpp \ |
| 78 |
../../grammar.cpp \ |
| 79 |
../../hiscore.cpp \ |
| 80 |
../../input.cpp \ |
| 81 |
../../intrinsic.cpp \ |
| 82 |
../../item.cpp \ |
| 83 |
../../map.cpp \ |
| 84 |
../../mobref.cpp \ |
| 85 |
../../msg.cpp \ |
| 86 |
../../name.cpp \ |
| 87 |
../../piety.cpp \ |
| 88 |
../../rand.cpp \ |
| 89 |
../../signpost.cpp \ |
| 90 |
../../smokestack.cpp \ |
| 91 |
../../speed.cpp \ |
| 92 |
../../sramstream.cpp \ |
| 93 |
../../stylus.cpp \ |
| 94 |
../../victory.cpp \ |
| 95 |
../../encyclopedia.cpp \ |
| 96 |
../../glbdef.cpp \ |
| 97 |
../../credits.cpp \ |
| 98 |
../../license.cpp \ |
| 99 |
../../gfx/all_bitmaps.cpp \ |
| 100 |
../../rooms/allrooms.cpp |
| 101 |
|
| 102 |
SFILES := |
| 103 |
BINFILES := |
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
LD := $(CXX) |
| 109 |
|
| 110 |
OFILES := $(addsuffix .o,$(BINFILES)) \ |
| 111 |
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) |
| 112 |
|
| 113 |
DEPENDS := $(OFILES:.o=.d) |
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
$(OUTPUT).ds.gba : $(OUTPUT).nds |
| 119 |
|
| 120 |
|
| 121 |
$(OUTPUT).nds: $(OUTPUT).arm9 |
| 122 |
ndstool -c powder.nds -7 $(DEVKITPRO)/libnds/basic.arm7 -9 powder.arm9 -b ../../gfx/icon_nds.bmp "POWDER `cat ../../VERSION.TXT`; By Jeff Lait; " |
| 123 |
|
| 124 |
$(OUTPUT).arm9 : $(OUTPUT).elf |
| 125 |
$(OUTPUT).elf : $(OFILES) |
| 126 |
|
| 127 |
|
| 128 |
%.bin.o : %.bin |
| 129 |
|
| 130 |
@echo $(notdir $<) |
| 131 |
@$(bin2o) |
| 132 |
|
| 133 |
|
| 134 |
-include $(DEPENDS) |
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
clean: |
| 139 |
@echo clean ... |
| 140 |
rm -f $(OFILES) $(DEPENDS) $(TARGET).elf $(TARGET).nds $(TARGET).arm9 $(TARGET).ds.gba |
| 141 |
|