NSPIRE_OS ?= os1_0_554 GCC = nspire-gcc LD = nspire-ld GCCFLAGS = -Os -Wall -W -fpic -fno-merge-constants -D $(NSPIRE_OS) OBJCOPY := "$(shell which arm-elf-objcopy 2>/dev/null)" ifeq (${OBJCOPY},"") OBJCOPY := arm-none-eabi-objcopy endif OBJS = main.o utils.o vpath %.tns ../../res/$(NSPIRE_OS) all: dlg3btn.tns %.o: %.c $(GCC) $(GCCFLAGS) -c $< %.o: %.S $(GCC) $(GCCFLAGS) -c $< dlg3btn.tns: $(OBJS) $(LD) $^ -o $(@:.tns=.elf) $(OBJCOPY) -O binary $(@:.tns=.elf) $(@:.tns=.bin) MakeTNS $(@:.tns=.bin) rm -f $(@:.tns=.bin) mkdir -p ../../res/$(NSPIRE_OS) mv $@ ../../res/$(NSPIRE_OS) .PHONY: clean clean: rm -f *.o *.elf