GCC = nspire-gcc LD = nspire-ld GCCFLAGS = -Os -Wall -W -marm LDFLAGS = 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 utils.o vector.o particle.o particle_system.o gravity_particles.o DISTDIR = ../../calcbin/samples vpath %.tns $(DISTDIR) all: particles.tns %.o: %.c $(GCC) $(GCCFLAGS) -c $< %.o: %.S $(GCC) $(GCCFLAGS) -c $< particles.tns: $(OBJS) $(LD) $(LDFLAGS) $^ -o $(@:.tns=.elf) @mkdir -p $(DISTDIR) $(OBJCOPY) -O binary $(@:.tns=.elf) $(DISTDIR)/$@ clean: rm -f *.o *.elf rm -f $(DISTDIR)/particles.tns