From fff83fc116653de37465ee6514e8071b7b72479b Mon Sep 17 00:00:00 2001 From: Alexander Egorenkov Date: Mon, 28 Jun 2021 10:13:20 +0200 Subject: [PATCH] hsavmcore: Let make create list of object files instead of hard-coding it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use idiomatic make constructs. Signed-off-by: Alexander Egorenkov Acked-by: Jan Höppner Signed-off-by: Jan Höppner --- hsavmcore/Makefile | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/hsavmcore/Makefile b/hsavmcore/Makefile index 544d7d71..7c1d4fd6 100644 --- a/hsavmcore/Makefile +++ b/hsavmcore/Makefile @@ -51,23 +51,14 @@ endif ALL_CFLAGS += $(FUSE_CFLAGS) $(SYSTEMD_CFLAGS) LDLIBS += $(FUSE_LDLIBS) $(SYSTEMD_LDLIBS) -lpthread -OBJECTS = \ - main.o \ - cmdline_options.o \ - config.o \ - mount.o \ - swap.o \ - hsa.o \ - hsa_file.o \ - hsa_mem.o \ - proxy.o \ - overlay.o +sources := $(wildcard *.c) +objects := $(patsubst %.c,%.o,$(sources)) libs = $(rootdir)/libutil/libutil.a all: hsavmcore -hsavmcore: $(OBJECTS) $(libs) +hsavmcore: $(objects) $(libs) $(LINK) $(ALL_LDFLAGS) $^ $(LDLIBS) -o $@ overlay.o: check-dep-fuse overlay.c overlay.h @@ -90,6 +81,6 @@ install: all endif # HAVE_FUSE clean: - rm -f hsavmcore $(OBJECTS) + rm -f hsavmcore $(objects) .PHONY: all install clean