GCC = nspire-gcc LD = nspire-ld GCCFLAGS = -O2 -Wall -W -marm LDFLAGS = OBJCOPY := "$(shell which arm-elf-objcopy 2>/dev/null)" ifeq (${OBJCOPY},"") OBJCOPY := arm-none-eabi-objcopy endif EXE = hide.tns OBJS = hide.o DISTDIR = .. 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)