GCC = nspire-gcc LD = nspire-ld GCCFLAGS = -Os -Wall -W LDFLAGS = -nostdlib OBJCOPY := "$(shell which arm-elf-objcopy 2>/dev/null)" ifeq (${OBJCOPY},"") OBJCOPY := arm-none-eabi-objcopy endif EXE = terminal.tns OBJS = terminal.o DISTDIR = ../../calcbin/samples vpath %.tns $(DISTDIR) all: $(EXE) %.o: %.c $(GCC) $(GCCFLAGS) -c $< $(EXE): $(OBJS) $(LD) $(LDFLAGS) $^ -o $(@:.tns=.elf) mkdir -p $(DISTDIR) $(OBJCOPY) -O binary $(@:.tns=.elf) $(DISTDIR)/$@ clean: rm -f *.o *.elf rm -f $(DISTDIR)/$(EXE)