Commits

Trammell Hudson  committed b41cbf7

started on makefile framework

  • Participants
  • Parent commits 98e11c9

Comments (0)

Files changed (2)

File Makefile.pebble

+#
+# Makefile for Pebble watch projects.
+#
+# The makefile should define:
+# 	SRCS with a list of source files.
+#	TARGET := project to build
+#
+PEBBLE_HOME := $(HOME)/build/pebble/sdk
+PYTHON := python
+
+GCC_PREFIX := $(HOME)/arm-cs-tools/bin/arm-none-eabi-
+
+CC := $(GCC_PREFIX)gcc
+LD := $(CC)
+OBJCOPY := $(GCC_PREFIX)objcopy
+
+
+CFLAGS += \
+	-std=c99 \
+	-g \
+	-O0 \
+	-Wall \
+	-Wextra \
+	-Wno-error=unused-function \
+	-Wno-error=unused-variable \
+	-Wno-error=unused-parameter \
+	-fPIE \
+	-I$(PEBBLE_HOME)/include \
+	-I. \
+	-I.. \
+	-DNDEBUG \
+
+LDFLAGS += \
+	-mcpu=cortex-m3	\
+	-mthumb	\
+	-Wl,--warn-common \
+	-fPIE \
+	-Wl,-Map,$(PEBBLE_HOME)/pebble-app.map,--emit-relocs \
+	-T/Users/hudson/build/pebble/th/hoelaat/pebble_app.ld \
+	-L$(PEBBLE_HOME)/lib \
+	-lpebble
+
+%.bin: %.elf
+	$(OBJCOPY) -O binary $< $@
+
+%.pbw: %.bin
+	$(PYTHON) $(PEBBLE_HOME)/tools/mkbundle.py \
+		--watchapp $< \
+		--watchapp-timestamp "`date "+%s"`" \
+		--req-fw 1 \
+		--resources resources.pbpack \
+		--resource-map resource_map.json \
+		--resources-timestamp "`date "+%s"`" \
+		-o $@ \
+
+all: $(TARGET).pbw
+$(TARGET).pbw: resources.pbpack
+$(TARGET).elf: $(OBJS)
+	$(LD) -o $@ $^ $(LDFLAGS)
+
+clean:
+	$(RM) *.elf *.o *.a a.out core

File hoelaat/src/Makefile

+#
+# Nederlands watch build
+#
+
+OBJS += nederlands.o
+
+TARGET := hoelaat
+
+
+include ../../Makefile.pebble