From 31913f8489f8e6eb624b6447d2e5cf1f6367bebf Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 18 Mar 2024 13:30:16 +0000 Subject: [PATCH] Make: make TOPDIR actually work and get rid of unused CDIR Signed-off-by: Richard Hughes Signed-off-by: Peter Jones --- Make.defaults | 2 +- apps/Makefile | 4 +--- gnuefi/Makefile | 4 +--- inc/Makefile | 5 +---- lib/Makefile | 4 +--- 5 files changed, 5 insertions(+), 14 deletions(-) diff --git a/Make.defaults b/Make.defaults index f0ae245..0068e31 100755 --- a/Make.defaults +++ b/Make.defaults @@ -34,7 +34,7 @@ # SUCH DAMAGE. # -TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) +TOPDIR ?= $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) # # Variables below overridable from command-line: diff --git a/apps/Makefile b/apps/Makefile index 9e4b2ee..18980f1 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -37,12 +37,10 @@ SRCDIR = . VPATH = $(SRCDIR) +TOPDIR = $(SRCDIR)/.. include $(SRCDIR)/../Make.defaults -TOPDIR = $(SRCDIR)/.. - -CDIR=$(TOPDIR)/.. LINUX_HEADERS = /usr/src/sys/build APPSDIR = $(LIBDIR)/gnuefi/apps CPPFLAGS += -D__KERNEL__ -I$(LINUX_HEADERS)/include diff --git a/gnuefi/Makefile b/gnuefi/Makefile index 02e8448..68dfced 100644 --- a/gnuefi/Makefile +++ b/gnuefi/Makefile @@ -37,12 +37,10 @@ SRCDIR = . VPATH = $(SRCDIR) +TOPDIR = $(SRCDIR)/.. include $(SRCDIR)/../Make.defaults -TOPDIR = $(SRCDIR)/.. - -CDIR=$(TOPDIR)/.. PKGCONFIGDIR ?= $(LIBDIR)/pkgconfig FILES = reloc_$(ARCH) diff --git a/inc/Makefile b/inc/Makefile index db3929f..b5de1fa 100644 --- a/inc/Makefile +++ b/inc/Makefile @@ -1,12 +1,9 @@ SRCDIR = . VPATH = $(SRCDIR) - -include $(SRCDIR)/../Make.defaults - TOPDIR = $(SRCDIR)/.. -CDIR=$(TOPDIR)/.. +include $(SRCDIR)/../Make.defaults all: diff --git a/lib/Makefile b/lib/Makefile index 07763de..ec1f9e3 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -37,12 +37,10 @@ SRCDIR = . VPATH = $(SRCDIR) +TOPDIR = $(SRCDIR)/.. include $(SRCDIR)/../Make.defaults -TOPDIR = $(SRCDIR)/.. - -CDIR = $(TOPDIR)/.. FILES = boxdraw smbios console crc data debug dpath \ entry error event exit guid hand hw init lock \ misc pause print sread str cmdline\