aboutsummaryrefslogtreecommitdiff
path: root/util/amdfwtool/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'util/amdfwtool/Makefile')
-rw-r--r--util/amdfwtool/Makefile20
1 files changed, 11 insertions, 9 deletions
diff --git a/util/amdfwtool/Makefile b/util/amdfwtool/Makefile
index e9fd91bb40..8f4208c354 100644
--- a/util/amdfwtool/Makefile
+++ b/util/amdfwtool/Makefile
@@ -1,16 +1,18 @@
-#*****************************************************************************
-#
-# All rights reserved.
-#
# SPDX-License-Identifier: BSD-3-Clause
-#*****************************************************************************
HOSTCC ?= cc
-amdfwtool_exe : amdfwtool.c
- $(HOSTCC) amdfwtool.c -o amdfwtool
+SRC = amdfwtool.c
+OBJ = $(SRC:%.c=%.o)
+TARGET = amdfwtool
+CFLAGS=-O2 -Wall -Wextra -Wshadow
-amdfwtool : amdfwtool_exe
+
+$(TARGET): $(OBJ)
+ $(CC) $(OBJ) $(LDFLAGS) -o $@
+
+%.o: %.c $(HEADER)
+ $(CC) $(CFLAGS) -c -o $@ $<
clean:
- @rm -f amdfwtool.o amdfwtool amdfwtool.exe
+ @rm -f $(TARGET) $(OBJ)