xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 1 | .EXPORT_ALL_VARIABLES: |
| 2 | include $(COMMON_MK) |
| 3 | |
| 4 | |
| 5 | EXEC = flags_tool |
| 6 | |
| 7 | SRCS=$(wildcard ./src/*.c) |
| 8 | OBJS = $(patsubst %.c,%.o,$(SRCS)) |
| 9 | |
| 10 | CFLAGS += -Wall -g |
| 11 | |
| 12 | CFLAGS += -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 | |
| 19 | CFLAGS += -O2 |
| 20 | |
| 21 | CFLAGS += -I./inc \ |
| 22 | |
| 23 | CFLAGS += -I../include |
| 24 | |
| 25 | LDLIBS += -lpthread |
| 26 | |
| 27 | LDLIBS += -lflags -L$(zte_lib_path)/libflags |
| 28 | |
| 29 | |
| 30 | #******************************************************************************* |
| 31 | # targets |
| 32 | #******************************************************************************* |
| 33 | all: $(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 | |
| 41 | romfs root_fs: |
| 42 | $(ROMFSINST) /bin/$(EXEC)_static |
| 43 | |
| 44 | clean: |
| 45 | -rm -f $(EXEC) $(EXEC)_static *.elf *.gdb *.o ./src/*.o |