Skip to content
Snippets Groups Projects
Commit 8df4d779 authored by Oleg Hahm's avatar Oleg Hahm
Browse files

* renamed makefiles to Makefile

* included a more convenient approach to organize Makefiles
parent d46f0425
No related branches found
No related tags found
No related merge requests found
File moved
File moved
File moved
## the cpu to build for
export CPU = msp430x16x
export MCU = msp430x1612
# toolchain config
export PREFIX = @msp430-
export CC = @$(PREFIX)gcc
export AR = @$(PREFIX)ar
export CFLAGS += -std=gnu99 -Wstrict-prototypes -gdwarf-2 -Os -Wall -mmcu=$(MCU)
export ASFLAGS += -mmcu=$(MCU) --defsym $(MCU)=1 --gdwarf-2
export AS = $(PREFIX)as
export LINK = $(PREFIX)gcc
export SIZE = $(PREFIX)size
export OBJCOPY = $(PREFIX)objcopy
export LINKFLAGS = -mmcu=$(MCU) -lgcc $(RIOTBASE)/bin/startup.o
export FLASHER = mspdebug
ifeq ($(strip $(PORT)),)
export PORT = /dev/ttyUSB0
endif
export HEXFILE = bin/$(PROJECT).hex
export FFLAGS = -d $(PORT) -j uif "prog $(HEXFILE)"
File moved
SRC = $(wildcard *.c)
BINDIR = bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
export ARCH = msb-430_base.a
DEP = $(SRC:%.c=$(BINDIR)%.d)
INCLUDES += -I$(RIOTBOARD)/msb-430-common/include/
INCLUDES += -I$(RIOTBASE)/cpu/msp430-common/include/
INCLUDES += -I$(RIOTBASE)/cpu/msp430x16x/include/
all: $(BINDIR)$(ARCH)
$(MAKE) -C ../msb-430-common
$(BINDIR)$(ARCH): $(OBJ)
mkdir -p $(BINDIR)
$(AR) rcs $(BINDIR)$(ARCH) $(OBJ)
# pull in dependency info for *existing* .o files
-include $(OBJ:.o=.d)
# compile and generate dependency info
$(BINDIR)%.o: %.c
$(CC) $(CFLAGS) $(INCLUDES) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -c $*.c -o $(BINDIR)$*.o
$(CC) $(CFLAGS) $(INCLUDES) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -MM $*.c > $(BINDIR)$*.d
@printf "$(BINDIR)"|cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d
# remove compilation products
clean:
$(MAKE) -C ../msb-430-common clean
rm -f $(BINDIR)$(ARCH) $(OBJ) $(DEP)
@if [ -d $(BINDIR) ] ; \
then rmdir $(BINDIR) ; \
fi
include $(RIOTBOARD)/msb-430-common/Makefile.include
File moved
File moved
File moved
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment