Makefile
771 Bytes
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
CC=gcc
CC_FLAGS=-c -Wall -Werror -std=gnu99 -g
CC_LIBS=-pthread -lusb-1.0
INCLUDES=
SOURCES=main.c printx.c ui.c serial.c nfc.c bus.c hvc.c heat.c pump.c usb.c
BMP=img/home.bmp img/main.bmp
MAP_SRC=map/main.bmp
OBJECTS=$(SOURCES:.c=.o)
BOZ=$(MAP_SRC:.bmp=.boz)
#BOZ=$(patsubst %_map.bmp,%.boz,$(MAP_SRC))
MAP=$(BOZ:.boz=.map)
BMPR=$(BMP:.bmp=.bmpr)
RGB=$(BMPR:.bmpr=.rgb)
OUTPUT=tweekd
all: $(SOURCES) pictures $(OUTPUT)
pictures: $(MAP_SRC) $(BMP) $(MAP) $(RGB)
$(OUTPUT): $(OBJECTS) $(MAP)
$(CC) $(OBJECTS) $(CC_LIBS) -o $@
%.o: %.c
$(CC) $(INCLUDES) $(CC_FLAGS) $< -o $@
%.rgb: %.bmpr
bmp2rgb565 $< $@
%.boz: %.bmp
cat $< > $@
%.bmpr: %.bmp
convert -flip $< $@
%.map: %.boz
bmp2map $< $@
clear:
rm -f $(OUTPUT) $(OBJECTS) $(BOZ) $(BMPR) $(MAP) $(RGB)