-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
108 lines (95 loc) · 2.54 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
binext=
target=pj64tosrm$(binext)
objects=pj64tosrm.o
cflags=-Wall
lflags=
libs=
ifeq ($(debug),1)
cflags += -ggdb
else
cflags += -s -O2
endif
cflags += $(extracflags)
dd=dd if=/dev/urandom count=1
all: $(target)
clean:
-rm -f $(target) $(objects)
test: all
@rm -f test.*
@echo 4kbit eeprom test
@rm -f test.*
@$(dd) of=test.eep bs=512 &> /dev/null
@md5sum test.eep &> test.md5
@./$(target) test.eep > /dev/null
@rm -f test.eep
@./$(target) test.srm > /dev/null
@md5sum --check < test.md5
@rm -f test.md5
@rm -f test.*
@echo 16kbit eeprom test
@rm -f test.*
@$(dd) of=test.eep bs=2048 &> /dev/null
@md5sum test.eep &> test.md5
@./$(target) test.eep > /dev/null
@rm -f test.eep
@./$(target) test.srm > /dev/null
@md5sum --check < test.md5
@rm -f test.md5
@rm -f test.*
@echo mempack test
@rm -f test.*
@$(dd) of=test.mpk bs=131072 &> /dev/null
@md5sum test.mpk &> test.md5
@./$(target) test.mpk > /dev/null
@rm -f test.mpk
@./$(target) test.srm > /dev/null
@md5sum --check < test.md5
@rm -f test.md5
@rm -f test.*
@echo sram test
@rm -f test.*
@$(dd) of=test.sra bs=32768 &> /dev/null
@md5sum test.sra &> test.md5
@./$(target) test.sra > /dev/null
@rm -f test.sra
@./$(target) test.srm > /dev/null
@md5sum --check < test.md5
@rm -f test.md5
@rm -f test.*
@echo flashram test
@rm -f test.*
@$(dd) of=test.fla bs=131072 &> /dev/null
@md5sum test.fla &> test.md5
@./$(target) test.fla > /dev/null
@rm -f test.fla
@./$(target) test.srm > /dev/null
@md5sum --check < test.md5
@rm -f test.md5
@echo full file 4kbit eeprom test
@rm -f test.*
@$(dd) of=test.eep bs=512 &> /dev/null
@$(dd) of=test.mpk bs=131072 &> /dev/null
@$(dd) of=test.sra bs=32768 &> /dev/null
@$(dd) of=test.fla bs=131072 &> /dev/null
@md5sum test.eep test.mpk test.sra test.fla &> test.md5
@./$(target) test.eep test.mpk test.sra test.fla > /dev/null
@rm -f test.eep test.mpk test.sra test.fla
@./$(target) test.srm > /dev/null
@md5sum --check < test.md5
@rm -f test.md5
@echo full file 16kbit eeprom test
@rm -f test.*
@$(dd) of=test.eep bs=2048 &> /dev/null
@$(dd) of=test.mpk bs=131072 &> /dev/null
@$(dd) of=test.sra bs=32768 &> /dev/null
@$(dd) of=test.fla bs=131072 &> /dev/null
@md5sum test.eep test.mpk test.sra test.fla &> test.md5
@./$(target) test.eep test.mpk test.sra test.fla > /dev/null
@rm -f test.eep test.mpk test.sra test.fla
@./$(target) test.srm > /dev/null
@md5sum --check < test.md5
@rm -f test.md5
$(target): $(objects)
$(CC) $(cflags) $(lflags) -o $@ $< $(libs)
%.o: %.c
$(CC) $(cflags) -c -o $@ $<