developer | 2a9e4fd | 2022-12-01 15:58:44 +0800 | [diff] [blame^] | 1 | # |
| 2 | # Copyright (C) 2022 MediaTek Inc. All rights reserved. |
| 3 | # |
| 4 | # This is free software, licensed under the GNU General Public License v2. |
| 5 | # See /LICENSE for more information. |
| 6 | # |
| 7 | |
| 8 | include libfdt/Makefile.libfdt |
| 9 | |
| 10 | OBJS := main.o $(LIBFDT_SRCS:%.c=libfdt/%.o) |
| 11 | DEPS := $(OBJS:%.o=%.d) |
| 12 | |
| 13 | CC ?= gcc |
| 14 | CFLAGS ?= -O2 -ffunction-sections |
| 15 | LDFLAGS ?= -Wl,--gc-sections |
| 16 | OPTFLAGS ?= -ggdb |
| 17 | |
| 18 | all: fdt-patch-dm-verify |
| 19 | |
| 20 | fdt-patch-dm-verify: $(OBJS) |
| 21 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) |
| 22 | |
| 23 | $(OBJS): %.o: %.c |
| 24 | $(CC) $(CFLAGS) $(OPTFLAGS) -Ilibfdt -MD -c -o $@ $< |
| 25 | |
| 26 | clean: libfdt_clean |
| 27 | rm -f fdt-patch-dm-verify $(OBJS) $(DEPS) |
| 28 | |
| 29 | .PHONY: clean |
| 30 | |
| 31 | -include $(DEPS) |