~basz/doorlight/trunk

« back to all changes in this revision

Viewing changes to mtests/off/Makefile

  • Committer: Bartek Szurgot
  • Date: 2013-02-28 16:27:35 UTC
  • Revision ID: bartek.szurgot@baszerr.eu-20130228162735-6zn5tpt2arv29o0n
test app to turn everything off

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
PROGRAM=off
 
2
OUT=$(PROGRAM).out
 
3
SRC=off.c
 
4
MCU_TYPE=attiny13
 
5
 
 
6
 
 
7
OBJ=$(SRC:.c=.o)
 
8
HEX_FILE=$(PROGRAM).hex
 
9
BIN_FILE=$(PROGRAM).bin
 
10
 
 
11
CC=avr-gcc
 
12
OBJ_CP=avr-objcopy
 
13
 
 
14
CFLAGS_COMMON=-Wall -mmcu=$(MCU_TYPE) -std=c99
 
15
CFLAGS+=$(CFLAGS_COMMON)
 
16
 
 
17
 
 
18
.PHONY: all
 
19
all: release
 
20
 
 
21
.PHONY: debug
 
22
debug: CFLAGS+=-g3
 
23
debug: hex bin
 
24
 
 
25
.PHONY: release
 
26
release: CFLAGS+=-O3 -DNDEBUG
 
27
release: hex bin
 
28
 
 
29
.PHONY: hex
 
30
hex: $(HEX_FILE)
 
31
 
 
32
.PHONY: bin
 
33
bin: $(BIN_FILE)
 
34
 
 
35
$(HEX_FILE): $(OUT)
 
36
        $(OBJ_CP) -O ihex $< $@
 
37
 
 
38
$(BIN_FILE): $(OUT)
 
39
        $(OBJ_CP) -O binary $< $@
 
40
 
 
41
$(OUT): $(OBJ)
 
42
        $(CC) $(CFLAGS) $(OBJ) -o $@
 
43
 
 
44
 
 
45
.PHONY: flash_mcu
 
46
flash_mcu:
 
47
        #uisp -dprog=stk200 --erase --upload if=$(HEX_FILE) --verify
 
48
        avrdude -P avrdoper -c stk500v2 -p t13 -U flash:w:$(PROGRAM).bin
 
49
 
 
50
.PHONY: clean
 
51
clean:
 
52
        rm -fv $(OUT) $(BIN_FILE) $(HEX_FILE) $(OBJ)
 
53