# $Id$ # PROGRAM = ficl LIBRARY = libficl SRCS = \ dictionary.c \ system.c \ fileaccess.c \ float.c \ double.c \ prefix.c \ search.c \ softcore.c \ stack.c \ tools.c \ vm.c \ primitives.c \ bit.c \ lzuncompress.c \ utility.c \ hash.c \ callback.c \ word.c \ extras.c \ ficlplatform/unix.c OBJS = $(SRCS:.c=.o) #******************************************************************************* # Define the ARM-specific compilation tools to be used. (Most NDS # developers include devkitPro's "base_rules" and "ds_rules" for these # definitions and for the suffix rules, but these files were written # without following the conventions used in Make's implicit rules. # The implicit rules work just fine for C and C++ files.) PREFIX = arm-eabi- AR = $(PREFIX)ar CC = $(PREFIX)gcc LD = $(PREFIX)gcc OBJCOPY = $(PREFIX)objcopy RANLIB = $(PREFIX)ranlib #******************************************************************************* CPPFLAGS := \ -DFICL_WANT_LZ_SOFTCORE=0 \ -Dlinux \ -DNDS \ -DARM9 \ -I. \ -I$(DEVKITPRO)/libnds/include CFLAGS := \ -g -Wall -O2 \ -ffast-math -fomit-frame-pointer \ -march=armv5te -mtune=arm946e-s \ -mthumb -mthumb-interwork LIBS = \ -L$(DEVKITPRO)/libnds/lib -lfat -lnds9 \ -L$(DEVKITARM)/arm-eabi/lib -lm LDFLAGS := \ -specs=ds_arm9.specs \ -mthumb -mthumb-interwork ARFLAGS = rv all:: $(LIBRARY).a $(PROGRAM).nds $(LIBRARY).a: $(OBJS) $(RM) $@ $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ $(PROGRAM).nds: StdIONDS.o $(PROGRAM).o $(OBJS) $(LD) $(LDFLAGS) -o $(PROGRAM).elf StdIONDS.o $(PROGRAM).o $(OBJS) $(LIBS) $(OBJCOPY) -O binary $(PROGRAM).elf $(PROGRAM).arm9 ndstool -c $@ -9 $(PROGRAM).arm9 $(PROGRAM).o: main.c $(COMPILE.c) -Dmain=$(PROGRAM) -o $@ $< StdIONDS.o: StdIONDS.c $(COMPILE.c) -DPROGRAM=$(PROGRAM) -DSPROGRAM=\"$(PROGRAM)\" -o $@ $< clean:: -$(RM) *.o $(LIBRARY).a $(PROGRAM).nds $(PROGRAM).arm9 $(PROGRAM).elf