Patrick Georgi | 7051707 | 2020-05-10 18:47:05 +0200 | [diff] [blame] | 1 | # SPDX-License-Identifier: BSD-3-Clause |
2 | |||||
Karthikeyan Ramasubramanian | 236245e | 2022-09-06 14:02:41 -0600 | [diff] [blame] | 3 | top ?= $(abspath ../..) |
Kangheui Won | 5b84dfd | 2021-12-21 15:45:06 +1100 | [diff] [blame] | 4 | ifneq ($(CC),) |
5 | HOSTCC ?= $(CC) | ||||
6 | else | ||||
Zheng Bao | 9c7ff7b | 2015-11-17 22:57:39 +0800 | [diff] [blame] | 7 | HOSTCC ?= cc |
Kangheui Won | 5b84dfd | 2021-12-21 15:45:06 +1100 | [diff] [blame] | 8 | endif |
Zheng Bao | 9c7ff7b | 2015-11-17 22:57:39 +0800 | [diff] [blame] | 9 | |
Robert Zieba | 29bc79f | 2022-03-14 15:59:12 -0600 | [diff] [blame] | 10 | TARGETS = amdfwread amdfwtool |
Kangheui Won | 5b84dfd | 2021-12-21 15:45:06 +1100 | [diff] [blame] | 11 | |
Robert Zieba | 29bc79f | 2022-03-14 15:59:12 -0600 | [diff] [blame] | 12 | all: $(TARGETS) |
Zheng Bao | 7698a55 | 2020-09-29 17:32:36 +0800 | [diff] [blame] | 13 | |
Martin Roth | 10291e8 | 2024-02-22 19:04:26 -0700 | [diff] [blame] | 14 | BUILD_ALL_TOOLS = 1 |
15 | include ./Makefile.mk | ||||
Robert Zieba | 29bc79f | 2022-03-14 15:59:12 -0600 | [diff] [blame] | 16 | |
Martin Roth | 10291e8 | 2024-02-22 19:04:26 -0700 | [diff] [blame] | 17 | amdfwread: $(amdfwreadobj) |
18 | $(HOSTCC) $(amdfwreadobj) $(LDFLAGS) -o $@ | ||||
Zheng Bao | 7698a55 | 2020-09-29 17:32:36 +0800 | [diff] [blame] | 19 | |
Martin Roth | 10291e8 | 2024-02-22 19:04:26 -0700 | [diff] [blame] | 20 | amdfwtool: $(amdfwtoolobj) |
21 | $(HOSTCC) $(amdfwtoolobj) $(LDFLAGS) -o $@ | ||||
22 | |||||
23 | %.o: %.c $(amdfwheader) | ||||
24 | $(HOSTCC) $(AMDFWTOOLCFLAGS) -c -o $@ $< | ||||
Zheng Bao | 9c7ff7b | 2015-11-17 22:57:39 +0800 | [diff] [blame] | 25 | |
26 | clean: | ||||
Martin Roth | 10291e8 | 2024-02-22 19:04:26 -0700 | [diff] [blame] | 27 | @rm -f $(TARGETS) $(amdfwreadobj) $(amdfwtoolobj) |
Felix Held | e862a00 | 2021-01-07 18:52:55 +0100 | [diff] [blame] | 28 | |
29 | distclean: clean | ||||
Martin Roth | d509076 | 2021-02-13 22:50:13 -0700 | [diff] [blame] | 30 | |
31 | help: | ||||
Robert Zieba | 29bc79f | 2022-03-14 15:59:12 -0600 | [diff] [blame] | 32 | @echo "${TARGETS}: Tools to create and read from AMD firmware combinations" |
Martin Roth | d509076 | 2021-02-13 22:50:13 -0700 | [diff] [blame] | 33 | @echo "Targets: all, clean, distclean, help" |
34 | @echo "To disable warnings as errors, run make as:" | ||||
35 | @echo " make all WERROR=\"\"" | ||||
36 | |||||
37 | .PHONY: all clean distclean help |