Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 39 lines (28 sloc) 1.212 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
# This template defines the things we want to add to the makefile for each app.
define APP_template

APP_RELS := $$(patsubst %.c,%.rel, $$(wildcard apps/$(1)/*.c)) $$(patsubst %.s,%.rel, $$(wildcard apps/$(1)/*.s))
APP_LIBS := dma.lib radio_com.lib radio_link.lib radio_mac.lib radio_registers.lib random.lib uart.lib usb.lib usb_cdc_acm.lib wixel.lib adc.lib gpio.lib
-include apps/$(1)/options.mk
APP_LIBS := $$(foreach lib, $$(APP_LIBS), libraries/lib/$$(lib))

RELs += $$(APP_RELS)
HEXs += apps/$(1)/$(1).hex

apps/$(1)/$(1).hex : $$(APP_RELS) $$(APP_LIBS)
$$(LINK_COMMAND)
$$(V)mv -f $$(@:%.hex=%.ihx) $$@

.PHONY : $(1)
$(1) : apps/$(1)/$(1).wxl

.PHONY : load_$(1)
load_$(1) : apps/$(1)/$(1).wxl
$$(WIXELCMD) write $$< $$(S) -a

.PHONY : open_$(1)
open_$(1) : apps/$(1)/$(1).wxl
$$(WIXELCONFIG) $$<
endef

# Auto detect the apps, and store the list of app names in the APPs variable.
APPs := $(foreach app, $(wildcard apps/*),$(notdir $(app)))

# Add information about each app to the Makefile.
$(foreach app, $(APPs), $(eval $(call APP_template,$(app))))

# Make a phony target called "apps" which builds all the apps.
# You can type "make apps" to build all the apps.
.PHONY : apps
apps: $(APPs)

Something went wrong with that request. Please try again.