Makefile 950 Bytes
Newer Older
1
CFILES=blink.c 
yids's avatar
yids committed
2 3
LIBCFILES=../libs/avrnacl/randombytes/randombytes.c
CFLAGS=-Os -pedantic -std=gnu99 -DARDUINO -I../libs/avrnacl/randombytes -I../libs/avrnacl/avrnacl_small/include
4 5 6 7 8 9 10 11
OPTIMIZE = -O3

MCU=atmega328p
F_CPU=F_CPU=16000000UL

AVRDUDE_PROGRAMMERID=stk200  /* Programmer ids are listed in /etc/avrdude.conf */
AVRDUDE_PORT=/dev/ttyUSB4

yids's avatar
yids committed
12 13
all: lib-test

14
blink: blink.c
yids's avatar
yids committed
15 16 17 18 19
	avr-gcc blink.c $(OPTIMZE) -g  -I AVRLIB/  -mmcu=$(MCU) -D$(F_CPU) $(CFLAGS) $(LIBCFILES) -o blink.elf
	avr-objcopy -j .text -j .data -O ihex blink.elf blink.hex
	rm blink.elf

lib-test: lib-test.c
yids's avatar
yids committed
20
	avr-gcc lib-test.c ../libs/pagerlib/pagerlib.c ../libs/pagerlib/things.c $(LIBCFILES) $(OPTIMZE) -g  -I AVRLIB/  -mmcu=$(MCU) -D$(F_CPU) $(CFLAGS) $(LIBCFILES) -o lib-test.elf
yids's avatar
yids committed
21 22
	avr-objcopy -j .text -j .data -O ihex lib-test.elf lib-test.hex
	rm lib-test.elf
23 24

upload:
yids's avatar
yids committed
25
	avrdude -carduino  -p atmega328p -P /dev/ttyUSB1 -b57600 -U flash:w:lib-test.hex
26 27

clean:
yids's avatar
yids committed
28
	rm -r *.elf *.hex