diff options
Diffstat (limited to 'util/amdfwtool/Makefile')
-rw-r--r-- | util/amdfwtool/Makefile | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/util/amdfwtool/Makefile b/util/amdfwtool/Makefile index 9392f02fed..b45178d535 100644 --- a/util/amdfwtool/Makefile +++ b/util/amdfwtool/Makefile @@ -7,41 +7,24 @@ else HOSTCC ?= cc endif -READ_SRC = amdfwread.c -READ_OBJ = $(READ_SRC:%.c=%.o) -TOOL_SRC = amdfwtool.c data_parse.c signed_psp.c handle_file.c -TOOL_OBJ = $(TOOL_SRC:%.c=%.o) -HEADER=amdfwtool.h TARGETS = amdfwread amdfwtool -WERROR=-Werror -CFLAGS :=-O2 -Wall -Wextra -Wshadow ${WERROR} -CFLAGS += -I $(top)/src/commonlib/bsd/include -CFLAGS += -D_GNU_SOURCE # memmem() from string.h - -ifneq ($(PKG_CONFIG),) -HOSTPKGCONFIG ?= $(PKG_CONFIG) -else -HOSTPKGCONFIG ?= pkg-config -endif -CFLAGS += $(shell $(HOSTPKGCONFIG) --cflags libcrypto) -ifneq ($(.SHELLSTATUS),0) -$(error "Ensure that pkg-config is installed.") -endif -LDFLAGS += $(shell $(HOSTPKGCONFIG) --libs libcrypto) all: $(TARGETS) -amdfwread: $(READ_OBJ) - $(HOSTCC) $(READ_OBJ) $(LDFLAGS) -o $@ +BUILD_ALL_TOOLS = 1 +include ./Makefile.mk + +amdfwread: $(amdfwreadobj) + $(HOSTCC) $(amdfwreadobj) $(LDFLAGS) -o $@ -amdfwtool: $(TOOL_OBJ) - $(HOSTCC) $(TOOL_OBJ) $(LDFLAGS) -o $@ +amdfwtool: $(amdfwtoolobj) + $(HOSTCC) $(amdfwtoolobj) $(LDFLAGS) -o $@ -%.o: %.c $(HEADER) - $(HOSTCC) $(CFLAGS) -c -o $@ $< +%.o: %.c $(amdfwheader) + $(HOSTCC) $(AMDFWTOOLCFLAGS) -c -o $@ $< clean: - @rm -f $(TARGETS) $(READ_OBJ) $(TOOL_OBJ) + @rm -f $(TARGETS) $(amdfwreadobj) $(amdfwtoolobj) distclean: clean |