Root/labsw/fw/Makefile

Source at commit a27d1958fb3a238dcdc9fe15e0d0649448409129 created 5 years 11 months ago.
By Werner Almesberger, ircstat/ML: update for 12/2013
1#
2# labsw/Makefile - Makefile for the Lab Switch firmware
3#
4# Written 2011 by Werner Almesberger
5# Copyright 2011 Werner Almesberger
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12
13
14MAIN = labsw
15OBJS = $(MAIN) usb descr version ep0
16
17F32XBASE = ../../../f32xbase
18
19include $(F32XBASE)/fw/common/Makefile.system
20include $(F32XBASE)/fw/common/Makefile.common
21
22CFLAGS += -Iinclude
23LDFLAGS += --code-size $(PAYLOAD_SIZE) --code-loc $(PAYLOAD_START)
24
25USB_ID = $(shell \
26  ( echo '\#include "usb-id.h"'; echo USB_VENDOR:USB_PRODUCT; ) | \
27  cpp | sed '/^ *$$/d;/^\#/d' )
28
29.PHONY: dfu
30
31all: $(MAIN)
32
33$(MAIN).rel: io-parts.h
34
35io-parts.h: io.h Makefile
36        cpp -dD $< | \
37          sed '1,/IO_H/d' | \
38          awk \
39          'BEGIN { print "/* MACHINE-GENERATED. DO NOT EDIT ! */"; \
40            print "#ifndef IO_PARTS_H"; \
41            print "#define IO_PARTS_H"; } \
42           /#define/ && $$3 != "" { \
43            split($$3, a, "_"); \
44            print $$1, $$2 "_PORT", a[1]; \
45            print $$1, $$2 "_MODE", a[1] "MDOUT"; \
46            print $$1, $$2 "_BIT", a[2]; } \
47           END { print "#endif" }' >$@ || \
48                { rm -f $@; exit 1; }
49
50clean::
51        rm -f io-parts.h
52
53# hack: for now, we just reuse the boot loader from cntr
54USB_ID = 20b7:cb72
55
56dfu:
57        dfu-util -d $(USB_ID) -D $(MAIN).bin
58

Archive Download this file

Branches:
master



interactive