# MSP430 Makefile # Change to your system's configuration # Microcontroller MMCU = msp430f2013 PROG = uif ELF = blink.elf SRC = $(wildcard *.c) OBJ = $(SRC:.c=.o) CC = msp430-elf-gcc LD = msp430-elf-gcc SIZE = msp430-elf-size STRIP = msp430-elf-strip CFLAGS := -mmcu=$(MMCU) -Os -Wall -pedantic -fdata-sections -ffunction-sections LDFLAGS := -mmcu=$(MMCU) -fdata-sections -ffunction-sections LDFLAGS += $(LDFLAGS) --specs=nosys.specs #-Wl,--gc-sections -Wl,--strip-all all: $(ELF) size debug: CFLAGS += -DDEBUG -g debug: all $(ELF): $(OBJ) @echo -e "\033[36;1mLinking... \033[0m$(ELF)" @$(LD) -o $(ELF) $(OBJ) $(LDFLAGS) prog: $(ELF) @mspdebug $(PROG) "prog $(ELF)" %.o:%.c @echo -e "\033[34;1mCompiling... \033[0m$<" @$(CC) -c $(CFLAGS) $< -o $@ clean: @-rm -f $(ELF) $(OBJ) size: $(ELF) @$(SIZE) $(ELF) strip: @$(STRIP) $(ELF)