DEBUG = FALSE GCC = nspire-gcc AS = nspire-as GXX = nspire-g++ LD = nspire-ld GENZEHN = genzehn GCCFLAGS = -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fpermissive LDFLAGS = -Wl,--gc-sections,--nspireio ZEHNFLAGS = --name "MouseLTE" --compress --uses-lcd-blit true ifeq ($(DEBUG),FALSE) GCCFLAGS += -O3 else GCCFLAGS += -O0 -g endif OBJS = $(patsubst %.c, %.o, $(shell find . -name \*.c)) OBJS += $(patsubst %.cpp, %.o, $(shell find . -name \*.cpp)) OBJS += $(patsubst %.S, %.o, $(shell find . -name \*.S)) EXE = MouseLTE DISTDIR = . vpath %.tns $(DISTDIR) vpath %.elf $(DISTDIR) all: $(EXE).tns %.o: %.c $(GCC) $(GCCFLAGS) -c $< -o $@ %.o: %.cpp $(GXX) $(GCCFLAGS) -c $< -o $@ %.o: %.S $(AS) -c $< -o $@ $(EXE).elf: $(OBJS) mkdir -p $(DISTDIR) $(LD) $^ -o $@ $(LDFLAGS) $(EXE).tns: $(EXE).elf $(GENZEHN) --input $^ --output $@.zehn $(ZEHNFLAGS) make-prg $@.zehn $@ rm $@.zehn rm /mnt/c/Users/sylva/Desktop/TInSpire/$(EXE).tns cp $(EXE).tns /mnt/c/Users/sylva/Desktop/TInSpire/ clean: rm -f $(OBJS) $(DISTDIR)/$(EXE).tns $(DISTDIR)/$(EXE).elf $(DISTDIR)/$(EXE).zehn