Patrick Georgi | 7051707 | 2020-05-10 18:47:05 +0200 | [diff] [blame] | 1 | # SPDX-License-Identifier: BSD-3-Clause |
| 2 | |
Zheng Bao | 9c7ff7b | 2015-11-17 22:57:39 +0800 | [diff] [blame] | 3 | HOSTCC ?= cc |
| 4 | |
Zheng Bao | c5e28ab | 2020-10-28 11:38:09 +0800 | [diff] [blame] | 5 | SRC = amdfwtool.c data_parse.c |
Zheng Bao | 7698a55 | 2020-09-29 17:32:36 +0800 | [diff] [blame] | 6 | OBJ = $(SRC:%.c=%.o) |
| 7 | TARGET = amdfwtool |
Zheng Bao | eb0404e | 2021-10-14 15:09:09 +0800 | [diff] [blame] | 8 | WERROR=-Werror -Wno-unused-function |
Martin Roth | d509076 | 2021-02-13 22:50:13 -0700 | [diff] [blame] | 9 | CFLAGS=-O2 -Wall -Wextra -Wshadow ${WERROR} |
Zheng Bao | 9c7ff7b | 2015-11-17 22:57:39 +0800 | [diff] [blame] | 10 | |
Patrick Georgi | d92d7cb | 2021-01-27 08:10:11 +0100 | [diff] [blame] | 11 | all: $(TARGET) |
Zheng Bao | 7698a55 | 2020-09-29 17:32:36 +0800 | [diff] [blame] | 12 | |
| 13 | $(TARGET): $(OBJ) |
| 14 | $(CC) $(OBJ) $(LDFLAGS) -o $@ |
| 15 | |
| 16 | %.o: %.c $(HEADER) |
| 17 | $(CC) $(CFLAGS) -c -o $@ $< |
Zheng Bao | 9c7ff7b | 2015-11-17 22:57:39 +0800 | [diff] [blame] | 18 | |
| 19 | clean: |
Zheng Bao | 7698a55 | 2020-09-29 17:32:36 +0800 | [diff] [blame] | 20 | @rm -f $(TARGET) $(OBJ) |
Felix Held | e862a00 | 2021-01-07 18:52:55 +0100 | [diff] [blame] | 21 | |
| 22 | distclean: clean |
Martin Roth | d509076 | 2021-02-13 22:50:13 -0700 | [diff] [blame] | 23 | |
| 24 | help: |
| 25 | @echo "${TARGET}: Create AMD Firmware combination" |
| 26 | @echo "Targets: all, clean, distclean, help" |
| 27 | @echo "To disable warnings as errors, run make as:" |
| 28 | @echo " make all WERROR=\"\"" |
| 29 | |
| 30 | .PHONY: all clean distclean help |