blob: 233cf559acdb4b0a1862fe03346d1a3b617cb472 [file] [log] [blame]
developerd92db592022-04-13 17:09:05 +08001#
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
8include libfdt/Makefile.libfdt
9
10OBJS := main.o $(LIBFDT_SRCS:%.c=libfdt/%.o)
11DEPS := $(OBJS:%.o=%.d)
12
13CC ?= gcc
14CFLAGS ?= -O2 -ffunction-sections
15LDFLAGS ?= -Wl,--gc-sections
16OPTFLAGS ?= -ggdb
17
18all: fdt-patch-dm-verify
19
20fdt-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
26clean: libfdt_clean
27 rm -f fdt-patch-dm-verify $(OBJS) $(DEPS)
28
29.PHONY: clean
30
31-include $(DEPS)