Browse Source

- autoset TARGET_ and REMOVE_ directory variables

master
vanhofen 4 years ago
parent
commit
9aeef7fda2
  1. 1
      Makefile
  2. 3
      make/environment-build.mk
  3. 84
      make/environment-target.mk
  4. 2
      make/target-rootfs.mk

1
Makefile

@ -85,7 +85,6 @@ include make/environment-box.mk
include make/environment-linux.mk include make/environment-linux.mk
include make/environment-build.mk include make/environment-build.mk
include make/environment-image.mk include make/environment-image.mk
include make/environment-target.mk
include make/environment-update.mk include make/environment-update.mk
printenv: printenv:

3
make/environment-build.mk

@ -38,7 +38,6 @@ ifeq ($(BOXSERIES), $(filter $(BOXSERIES), hd5x))
endif endif
DEPS_DIR = $(BASE_DIR)/deps DEPS_DIR = $(BASE_DIR)/deps
D = $(DEPS_DIR) D = $(DEPS_DIR)
TARGET_DIR ?= $(BASE_DIR)/root
SOURCE_DIR ?= $(BASE_DIR)/source SOURCE_DIR ?= $(BASE_DIR)/source
MAKE_DIR = $(BASE_DIR)/make MAKE_DIR = $(BASE_DIR)/make
LOCAL_DIR = $(BASE_DIR)/local LOCAL_DIR = $(BASE_DIR)/local
@ -146,6 +145,8 @@ else ifeq ($(BOXSERIES), $(filter $(BOXSERIES), vuduo))
endif endif
include make/environment-target.mk
STATIC_libdir = $(STATIC_DIR)/$(prefix)/lib STATIC_libdir = $(STATIC_DIR)/$(prefix)/lib
TARGET_CFLAGS = -pipe $(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) $(TARGET_ABI) $(TARGET_EXTRA_CFLAGS) $(CXX11_ABI) -I$(TARGET_includedir) TARGET_CFLAGS = -pipe $(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) $(TARGET_ABI) $(TARGET_EXTRA_CFLAGS) $(CXX11_ABI) -I$(TARGET_includedir)

84
make/environment-target.mk

@ -16,7 +16,7 @@ base_datadir = $(base_datarootdir)
base_includedir = $(base_prefix)/include base_includedir = $(base_prefix)/include
base_libdir = $(base_prefix)/lib base_libdir = $(base_prefix)/lib
modulesdir = $(base_libdir)/modules modulesdir = $(base_libdir)/modules/$(KERNEL_VER)
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@ -43,55 +43,57 @@ libdir = $(exec_prefix)/lib
lispdir = $(datarootdir)/emacs/site-lisp lispdir = $(datarootdir)/emacs/site-lisp
localedir = $(datarootdir)/locale localedir = $(datarootdir)/locale
mandir = $(datadir)/man mandir = $(datadir)/man
mandir1 = $(mandir)/man1 man1dir = $(mandir)/man1
mandir2 = $(mandir)/man2 man2dir = $(mandir)/man2
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
REMOVE_dir = /.remove dir_VARIABLES = prefix \
REMOVE_bindir = $(REMOVE_dir)/bin exec_prefix \
REMOVE_sbindir = $(REMOVE_dir)/sbin base_bindir \
REMOVE_libexecdir = $(REMOVE_dir)/libexec base_sbindir \
REMOVE_datarootdir = $(REMOVE_dir)/share base_datarootdir \
REMOVE_datadir = $(REMOVE_datarootdir) base_datadir \
REMOVE_sysconfdir = $(REMOVE_dir)/etc base_includedir \
REMOVE_sharedstatedir = $(REMOVE_dir)/com base_libdir \
REMOVE_localstatedir = $(REMOVE_dir)/var modulesdir \
REMOVE_runstatedir = $(REMOVE_localstatedir)/run bindir \
REMOVE_includedir = $(REMOVE_dir)/include sbindir \
REMOVE_oldincludedir = $(REMOVE_includedir) libexecdir \
REMOVE_docdir = $(REMOVE_datarootdir)/doc datarootdir \
REMOVE_infodir = $(REMOVE_datarootdir)/info datadir \
REMOVE_htmldir = $(REMOVE_docdir) sysconfdir \
REMOVE_dvidir = $(REMOVE_docdir) sharedstatedir \
REMOVE_pdfdir = $(REMOVE_docdir) localstatedir \
REMOVE_psdir = $(REMOVE_docdir) runstatedir \
REMOVE_libdir = $(REMOVE_dir)/lib includedir \
REMOVE_lispdir = $(REMOVE_datarootdir)/emacs/site-lisp oldincludedir \
REMOVE_localedir = $(REMOVE_datarootdir)/locale docdir \
REMOVE_mandir = $(REMOVE_datarootdir)/man infodir \
REMOVE_man1dir = $(REMOVE_mandir)/man1 htmldir \
REMOVE_man2dir = $(REMOVE_mandir)/man2 dvidir \
pdfdir \
psdir \
libdir \
lispdir \
localedir \
mandir \
man1dir \
man2dir
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
TARGET_prefix = $(TARGET_DIR)$(prefix) TARGET_DIR ?= $(BASE_DIR)/root
TARGET_exec_prefix = $(TARGET_DIR)$(exec_prefix)
TARGET_base_bindir = $(TARGET_DIR)$(base_bindir) # auto-set TARGET_ directories
TARGET_base_sbindir = $(TARGET_DIR)$(base_sbindir) $(foreach dir,$(dir_VARIABLES),$(eval TARGET_$(dir) = $(TARGET_DIR)$($(dir))))
TARGET_base_includedir = $(TARGET_DIR)$(base_includedir)
TARGET_base_libdir = $(TARGET_DIR)$(base_libdir)
TARGET_modulesdir = $(TARGET_base_libdir)/modules/$(KERNEL_VER) # -----------------------------------------------------------------------------
REMOVE_DIR = /.remove
TARGET_bindir = $(TARGET_DIR)$(bindir) # auto-set REMOVE_ directories
TARGET_sbindir = $(TARGET_DIR)$(sbindir) $(foreach dir,$(dir_VARIABLES),$(eval REMOVE_$(dir) = $(REMOVE_DIR)$($(dir))))
TARGET_libdir = $(TARGET_DIR)$(libdir)
TARGET_datadir = $(TARGET_DIR)$(datadir)
TARGET_sysconfdir = $(TARGET_DIR)$(sysconfdir)
TARGET_includedir = $(TARGET_DIR)$(includedir)
TARGET_localstatedir = $(TARGET_DIR)$(localstatedir)
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------

2
make/target-rootfs.mk

@ -105,7 +105,7 @@ $(ROOTFS): | $(TARGET_DIR)
# cleanup root filesystem from useless stuff # cleanup root filesystem from useless stuff
rootfs-cleanup: $(ROOTFS) rootfs-cleanup: $(ROOTFS)
rm -rf $(ROOTFS)$(REMOVE_dir) rm -rf $(ROOTFS)$(REMOVE_DIR)
rm -rf $(ROOTFS)$(base_includedir) rm -rf $(ROOTFS)$(base_includedir)
rm -rf $(ROOTFS)$(includedir) rm -rf $(ROOTFS)$(includedir)
rm -rf $(ROOTFS)$(libdir)/pkgconfig rm -rf $(ROOTFS)$(libdir)/pkgconfig

Loading…
Cancel
Save