blob: dffd1dd6c1ed655b68724d02d6d9f1532546945f [file] [log] [blame]
xf.li6c8fc1e2023-08-12 00:11:09 -07001.EXPORT_ALL_VARIABLES:
2include $(COMMON_MK)
3
4
5EXEC = flags_tool
6
7SRCS=$(wildcard ./src/*.c)
8OBJS = $(patsubst %.c,%.o,$(SRCS))
9
10CFLAGS += -Wall -g
11
12CFLAGS += -Werror=implicit-int \
13 -Werror=implicit-function-declaration \
14 -Werror=float-equal \
15 -Werror=return-type \
16 -Werror=enum-compare \
17 -Werror=init-self
18
19CFLAGS += -O2
20
21CFLAGS += -I./inc \
22
23CFLAGS += -I../include
24
25LDLIBS += -lpthread
26
27LDLIBS += -lflags -L$(zte_lib_path)/libflags
28
29
30#*******************************************************************************
31# targets
32#*******************************************************************************
33all: $(EXEC)
34
35$(EXEC): $(OBJS)
36 $(CC) $(LDFLAGS) -o $@ $^ -Wl,--start-group $(LDLIBS) $(LDLIBS_$@) -Wl,--end-group
37 $(CC) $(LD_BEGIN) -static $(LDFLAGS) -o $@_static $^ -Wl,--start-group $(LDLIBS) $(LDLIBS_$@) -Wl,--end-group $(LD_END)
38 cp $(EXEC) $(EXEC).elf
39 cp $(EXEC)_static $(EXEC)_static.elf
40
41romfs root_fs:
42 $(ROMFSINST) /bin/$(EXEC)_static
43
44clean:
45 -rm -f $(EXEC) $(EXEC)_static *.elf *.gdb *.o ./src/*.o