Commits

Trammell Hudson committed 08e7e22

makefile building works!

Comments (0)

Files changed (5)

 resource_ids.auto.h
 resources.pbpack*
 *.log
+*.map
 
 BUILD_TIME := $(shell date "+%s")
 
+ARCH_FLAGS += \
+	-mcpu=cortex-m3 \
+	-mthumb \
 
 CFLAGS += \
 	-std=c99 \
+	$(ARCH_FLAGS) \
 	-g \
 	-O0 \
 	-Wall \
 	-DNDEBUG \
 
 LDFLAGS += \
-	-mcpu=cortex-m3	\
-	-mthumb	\
+	$(ARCH_FLAGS) \
 	-Wl,--warn-common \
 	-fPIE \
-	-Wl,-Map,$(PEBBLE_HOME)/pebble-app.map,--emit-relocs \
+	-Wl,-Map,$(TARGET).map,--emit-relocs \
 	-T$(PEBBLE_HOME)/pebble_app.ld \
+
+LDLIBS += \
 	-L$(PEBBLE_HOME)/lib \
 	-lpebble \
 
 %.bin: %.elf
 	$(OBJCOPY) -O binary $< $@
+	$(PYTHON) $(PEBBLE_HOME)/waftools/inject_metadata.py \
+		$@
 
 %.pbw: %.bin
 	$(PYTHON) $(PEBBLE_HOME)/tools/mkbundle.py \
 		--watchapp $< \
 		--watchapp-timestamp $(BUILD_TIME) \
 		--req-fw 1 \
-		--resources resources.pbpack \
+		--resources app_resources.pbpack \
 		--resource-map resource_map.json \
 		--resources-timestamp $(BUILD_TIME) \
 		-o $@ \
+		-v \
 
 all: $(TARGET).pbw
 $(TARGET).elf: $(OBJS)
-	$(LD) -o $@ $^ $(LDFLAGS)
-$(TARGET).pbw: $(TARGET).bin resources.pbpack
+	$(LD) \
+		$(LDFLAGS) \
+		-o $@ \
+		$^ \
+		$(LDLIBS) \
+
+$(TARGET).pbw: app_resources.pbpack
 
 #
 # Every object requires that the resource_ids.auto.h be up to date
 
 clean:
 	$(RM) \
-		*.pbw \
-		*.pfo \
-		*.elf \
-		*.bin \
-		*.o \
-		*.a \
+		*.{o,a,pbw,pfo,elf,bin,map} \
 		a.out \
 		core \
 		*.pbpack \
 #
 # Generate a resource binary from all of the fonts
 #
-resources.pbpack: \
-	resources.pbpack.manifest \
-	resources.pbpack.table \
-	resources.pbpack.data \
+app_resources.pbpack: \
+	app_resources.pbpack.manifest \
+	app_resources.pbpack.table \
+	app_resources.pbpack.data \
 
 	cat > $@ $^
 
 
 RESOURCES := $(FONTS) resource_map.json
 
-resources.pbpack.data: $(RESOURCES)
+app_resources.pbpack.data: $(RESOURCES)
 	cat > $@ $^
 
-resources.pbpack.table: $(RESOURCES)
+app_resources.pbpack.table: $(RESOURCES)
 	$(PYTHON) $(PEBBLE_HOME)/tools/pbpack_meta_data.py \
 		table \
 		$@ \
 		$< \
 
 # This header file name is forced by <pebble_app.h>
-resource_ids.auto.h: resources.pbpack.data $(FONTS)
+resource_ids.auto.h: app_resources.pbpack.data $(FONTS)
 	$(PYTHON) $(PEBBLE_HOME)/tools/generate_resource_code.py \
 		resource_header \
 		$@ \
 		pebble_os.h \
 		$< \
 		$(RESOURCE_LIST) \
+		resource_map.json DUMMY \
 #include "sha1.h"
 
 PBL_APP_INFO(
-	"Two Factor",
+	"2wo Factor",
 	"hudson",
 	1, // Version
 	INVALID_RESOURCE,

hoelaat/resources/src/resource_map.json

 {
 	"friendlyVersion": "0.1",
-	"versionDefName": "HOELAAT_RESOURCES",
+	"versionDefName": "RESOURCES",
 	"media": [
 		{
 			"type":"font",
-			"defName":"FONT_ANDALE_30",
+			"defName":"FONT_ARIAL_28",
 			"file":"fonts/Arial.ttf"
 		},
 		{
 			"type":"font",
-			"defName":"FONT_ANDALE_30_BLACK",
+			"defName":"FONT_ARIAL_BLACK_30",
 			"file":"fonts/Arial-Black.ttf"
 		},
 		{
-			"type":"font",
-			"defName":"FONT_ANDALE_28",
-			"file":"fonts/Arial.ttf"
-		},
-		{
 			"type":"raw",
 			"defName":"DUMMY",
 			"file":"resource_map.json"

hoelaat/src/Makefile

 OBJS += nederlands.o
 
 TARGET := hoelaat
+
 FONTS := \
 	Arial.28.pfo \
 	Arial-Black.30.pfo \