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