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