1#
2# Makefile
3#
4CC ?= gcc
5LVGL_DIR ?= ${shell pwd}/../..
6LVGL_DIR_NAME ?= lvgl
7
8WARNINGS = -Werror -Wall -Wextra \
9           -Wshadow -Wundef -Wmaybe-uninitialized -Wmissing-prototypes -Wpointer-arith -Wuninitialized \
10           -Wunreachable-code -Wreturn-type -Wmultichar -Wformat-security -Wdouble-promotion -Wclobbered -Wdeprecated  \
11           -Wempty-body -Wshift-negative-value -Wstack-usage=2048 \
12           -Wtype-limits -Wsizeof-pointer-memaccess
13
14#-Wno-unused-value -Wno-unused-parameter
15OPTIMIZATION ?= -O3 -g0
16
17
18CFLAGS ?= -I$(LVGL_DIR)/ $(DEFINES) $(WARNINGS) $(OPTIMIZATION) -I$(LVGL_DIR) -I.
19
20LDFLAGS ?=  -lpng
21BIN ?= demo
22
23
24#Collect the files to compile
25MAINSRC = ./lv_test_main.c
26
27include ../lvgl.mk
28
29CSRCS += lv_test_assert.c
30CSRCS += lv_test_core/lv_test_core.c
31CSRCS += lv_test_core/lv_test_obj.c
32CSRCS += lv_test_core/lv_test_style.c
33CSRCS += lv_test_core/lv_test_font_loader.c
34CSRCS += lv_test_widgets/lv_test_label.c
35CSRCS += lv_test_fonts/font_1.c
36CSRCS += lv_test_fonts/font_2.c
37CSRCS += lv_test_fonts/font_3.c
38
39OBJEXT ?= .o
40
41AOBJS = $(ASRCS:.S=$(OBJEXT))
42COBJS = $(CSRCS:.c=$(OBJEXT))
43
44MAINOBJ = $(MAINSRC:.c=$(OBJEXT))
45
46SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
47OBJS = $(AOBJS) $(COBJS)
48
49## MAINOBJ -> OBJFILES
50
51all: default
52
53%.o: %.c
54	@$(CC)  $(CFLAGS) -c $< -o $@
55	@echo "CC $<"
56
57default: $(AOBJS) $(COBJS) $(MAINOBJ)
58	$(CC) -o $(BIN) $(MAINOBJ) $(AOBJS) $(COBJS) $(LDFLAGS)
59
60clean:
61	rm -f $(BIN) $(AOBJS) $(COBJS) $(MAINOBJ)
62
63