Makefile

Thu, 16 Feb 2017 16:24:25 +0100

author
Malte Di Donato <mdd@neo-soft.org>
date
Thu, 16 Feb 2017 16:24:25 +0100
changeset 4
99a5439f349f
parent 1
31032bc7b0e6
permissions
-rw-r--r--

calibration tests added

1
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
1 # Name: Makefile
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
2 # Project: hid-data example
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
3 # Author: Christian Starkjohann
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
4 # Creation Date: 2008-04-07
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
5 # Tabsize: 4
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
6 # Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
7 # License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
8
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
9 DEVICE = attiny2313
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
10 F_CPU = 16000000 # in Hz
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
11 FUSE_L = # see below for fuse values for particular devices
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
12 FUSE_H =
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
13 AVRDUDE = avrdude -c usbasp -p $(DEVICE) -B .5 -P USB -u
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
14
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
15 CFLAGS = -Iusbdrv -I. -DDEBUG_LEVEL=0
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
16 OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
17
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
18 COMPILE = avr-gcc -Wall -Os -DF_CPU=$(F_CPU) $(CFLAGS) -mmcu=$(DEVICE)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
19
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
20 ##############################################################################
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
21 # Fuse values for particular devices
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
22 ##############################################################################
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
23 # If your device is not listed here, go to
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
24 # http://palmavr.sourceforge.net/cgi-bin/fc.cgi
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
25 # and choose options for external crystal clock and no clock divider
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
26 #
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
27 ################################## ATMega8 ##################################
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
28 # ATMega8 FUSE_L (Fuse low byte):
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
29 # 0x9f = 1 0 0 1 1 1 1 1
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
30 # ^ ^ \ / \--+--/
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
31 # | | | +------- CKSEL 3..0 (external >8M crystal)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
32 # | | +--------------- SUT 1..0 (crystal osc, BOD enabled)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
33 # | +------------------ BODEN (BrownOut Detector enabled)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
34 # +-------------------- BODLEVEL (2.7V)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
35 # ATMega8 FUSE_H (Fuse high byte):
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
36 # 0xc9 = 1 1 0 0 1 0 0 1 <-- BOOTRST (boot reset vector at 0x0000)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
37 # ^ ^ ^ ^ ^ ^ ^------ BOOTSZ0
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
38 # | | | | | +-------- BOOTSZ1
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
39 # | | | | + --------- EESAVE (don't preserve EEPROM over chip erase)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
40 # | | | +-------------- CKOPT (full output swing)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
41 # | | +---------------- SPIEN (allow serial programming)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
42 # | +------------------ WDTON (WDT not always on)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
43 # +-------------------- RSTDISBL (reset pin is enabled)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
44 #
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
45 ############################## ATMega48/88/168 ##############################
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
46 # ATMega*8 FUSE_L (Fuse low byte):
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
47 # 0xdf = 1 1 0 1 1 1 1 1
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
48 # ^ ^ \ / \--+--/
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
49 # | | | +------- CKSEL 3..0 (external >8M crystal)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
50 # | | +--------------- SUT 1..0 (crystal osc, BOD enabled)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
51 # | +------------------ CKOUT (if 0: Clock output enabled)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
52 # +-------------------- CKDIV8 (if 0: divide by 8)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
53 # ATMega*8 FUSE_H (Fuse high byte):
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
54 # 0xde = 1 1 0 1 1 1 1 0
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
55 # ^ ^ ^ ^ ^ \-+-/
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
56 # | | | | | +------ BODLEVEL 0..2 (110 = 1.8 V)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
57 # | | | | + --------- EESAVE (preserve EEPROM over chip erase)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
58 # | | | +-------------- WDTON (if 0: watchdog always on)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
59 # | | +---------------- SPIEN (allow serial programming)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
60 # | +------------------ DWEN (debug wire enable)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
61 # +-------------------- RSTDISBL (reset pin is enabled)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
62 #
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
63 ############################## ATTiny25/45/85 ###############################
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
64 # ATMega*5 FUSE_L (Fuse low byte):
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
65 # 0xef = 1 1 1 0 1 1 1 1
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
66 # ^ ^ \+/ \--+--/
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
67 # | | | +------- CKSEL 3..0 (clock selection -> crystal @ 12 MHz)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
68 # | | +--------------- SUT 1..0 (BOD enabled, fast rising power)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
69 # | +------------------ CKOUT (clock output on CKOUT pin -> disabled)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
70 # +-------------------- CKDIV8 (divide clock by 8 -> don't divide)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
71 # ATMega*5 FUSE_H (Fuse high byte):
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
72 # 0xdd = 1 1 0 1 1 1 0 1
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
73 # ^ ^ ^ ^ ^ \-+-/
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
74 # | | | | | +------ BODLEVEL 2..0 (brownout trigger level -> 2.7V)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
75 # | | | | +---------- EESAVE (preserve EEPROM on Chip Erase -> not preserved)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
76 # | | | +-------------- WDTON (watchdog timer always on -> disable)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
77 # | | +---------------- SPIEN (enable serial programming -> enabled)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
78 # | +------------------ DWEN (debug wire enable)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
79 # +-------------------- RSTDISBL (disable external reset -> enabled)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
80 #
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
81 ################################ ATTiny2313 #################################
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
82 # ATTiny2313 FUSE_L (Fuse low byte):
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
83 # 0xef = 1 1 1 0 1 1 1 1
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
84 # ^ ^ \+/ \--+--/
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
85 # | | | +------- CKSEL 3..0 (clock selection -> crystal @ 12 MHz)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
86 # | | +--------------- SUT 1..0 (BOD enabled, fast rising power)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
87 # | +------------------ CKOUT (clock output on CKOUT pin -> disabled)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
88 # +-------------------- CKDIV8 (divide clock by 8 -> don't divide)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
89 # ATTiny2313 FUSE_H (Fuse high byte):
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
90 # 0xdb = 1 1 0 1 1 0 1 1
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
91 # ^ ^ ^ ^ \-+-/ ^
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
92 # | | | | | +---- RSTDISBL (disable external reset -> enabled)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
93 # | | | | +-------- BODLEVEL 2..0 (brownout trigger level -> 2.7V)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
94 # | | | +-------------- WDTON (watchdog timer always on -> disable)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
95 # | | +---------------- SPIEN (enable serial programming -> enabled)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
96 # | +------------------ EESAVE (preserve EEPROM on Chip Erase -> not preserved)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
97 # +-------------------- DWEN (debug wire enable)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
98
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
99 FUSE_H = 0xdb
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
100 FUSE_L = 0xef
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
101
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
102 # symbolic targets:
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
103 help:
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
104 @echo "This Makefile has no default rule. Use one of the following:"
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
105 @echo "make hex ....... to build main.hex"
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
106 @echo "make program ... to flash fuses and firmware"
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
107 @echo "make fuse ...... to flash the fuses"
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
108 @echo "make flash ..... to flash the firmware (use this on metaboard)"
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
109 @echo "make clean ..... to delete objects and hex file"
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
110
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
111 hex: main.hex
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
112
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
113 program: flash fuse
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
114
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
115 # rule for programming fuse bits:
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
116 fuse:
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
117 @[ "$(FUSE_H)" != "" -a "$(FUSE_L)" != "" ] || \
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
118 { echo "*** Edit Makefile and choose values for FUSE_L and FUSE_H!"; exit 1; }
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
119 $(AVRDUDE) -U hfuse:w:$(FUSE_H):m -U lfuse:w:$(FUSE_L):m
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
120
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
121 # rule for uploading firmware:
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
122 flash: main.hex
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
123 $(AVRDUDE) -U flash:w:main.hex:i
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
124
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
125 # rule for deleting dependent files (those which can be built by Make):
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
126 clean:
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
127 rm -f main.hex main.lst main.obj main.cof main.list main.map main.eep.hex main.elf *.o usbdrv/*.o main.s usbdrv/oddebug.s usbdrv/usbdrv.s
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
128
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
129 # Generic rule for compiling C files:
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
130 .c.o:
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
131 $(COMPILE) -c $< -o $@
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
132
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
133 # Generic rule for assembling Assembler source files:
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
134 .S.o:
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
135 $(COMPILE) -x assembler-with-cpp -c $< -o $@
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
136 # "-x assembler-with-cpp" should not be necessary since this is the default
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
137 # file type for the .S (with capital S) extension. However, upper case
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
138 # characters are not always preserved on Windows. To ensure WinAVR
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
139 # compatibility define the file type manually.
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
140
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
141 # Generic rule for compiling C to assembler, used for debugging only.
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
142 .c.s:
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
143 $(COMPILE) -S $< -o $@
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
144
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
145 # file targets:
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
146
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
147 # Since we don't want to ship the driver multipe times, we copy it into this project:
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
148 usbdrv:
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
149 cp -r ../../../usbdrv .
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
150
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
151 main.elf: usbdrv $(OBJECTS) # usbdrv dependency only needed because we copy it
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
152 $(COMPILE) -o main.elf $(OBJECTS)
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
153
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
154 main.hex: main.elf
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
155 rm -f main.hex main.eep.hex
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
156 avr-objcopy -j .text -j .data -O ihex main.elf main.hex
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
157 avr-size main.hex
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
158
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
159 # debugging targets:
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
160
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
161 disasm: main.elf
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
162 avr-objdump -d main.elf
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
163
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
164 cpp:
31032bc7b0e6 added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff changeset
165 $(COMPILE) -E main.c

mercurial