GCC = nspire-g++ LD = nspire-ld GCCFLAGS = -Os -nostdlib -I"../../../../TI/nRGBlib/src/include" LDFLAGS = -L "../../../../TI/nRGBlib/src/lib" OBJCOPY := "$(shell (which arm-elf-objcopy arm-none-eabi-objcopy arm-linux-gnueabi-objcopy | head -1) 2>/dev/null)" ifeq (${OBJCOPY},"") OBJCOPY := arm-none-eabi-objcopy endif OBJS = main.o Board.o #DISTDIR = bin/ DISTDIR = ../bin vpath %.tns $(DISTDIR) all: nStacker.tns %.o: %.cpp $(GCC) $(GCCFLAGS) -c $< %.o: %.S $(GCC) $(GCCFLAGS) -c $< nStacker.tns: $(OBJS) $(LD) $(LDFLAGS) $^ -o $(@:.tns=.elf) -lRGB @mkdir -p $(DISTDIR) $(OBJCOPY) -O binary $(@:.tns=.elf) $(DISTDIR)/$@ clean: rm -f *.o *.elf rm -f $(DISTDIR)/nStacker.tns