Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Makefile #51

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 1 addition & 47 deletions toolkit/Makefile
Original file line number Diff line number Diff line change
@@ -1,55 +1,15 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

# Contains:
# - Definitions
# - High Level Targets
# - Submake Includes

######## DEFINITIONS ########

toolkit_root := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
SCRIPTS_DIR ?= $(toolkit_root)/scripts

######## SET REMAINING FLAGS ########

RUN_CHECK ?= n

##help:var:REPO_SNAPSHOT_TIME:<posix_time>=Posix time to be used as a snapshot for remote repositories when fetching packages. Example: REPO_SNAPSHOT_TIME="1724119509".
CACHE_DIR ?=
PACKAGE_CACHE_SUMMARY ?=
IMAGE_CACHE_SUMMARY ?=
INITRD_CACHE_SUMMARY ?=
PACKAGE_ARCHIVE ?=
PACKAGE_BUILD_RETRIES ?= 0
CHECK_BUILD_RETRIES ?= 0
EXTRA_BUILD_LAYERS ?= 0
REFRESH_WORKER_CHROOT ?= y
TARGET_ARCH ?=
ALLOW_TOOLCHAIN_REBUILDS ?= n
CACHED_PACKAGES_ARCHIVE ?=
USE_CCACHE ?= n

# Folder defines
TOOLS_DIR ?= $(toolkit_root)/tools
TOOL_BINS_DIR ?= $(toolkit_root)/out/tools
RESOURCES_DIR ?= $(toolkit_root)/resources

PROJECT_ROOT ?= $(realpath $(toolkit_root)/..)
BUILD_DIR ?= $(PROJECT_ROOT)/build
OUT_DIR ?= $(PROJECT_ROOT)/out
CCACHE_DIR ?= $(PROJECT_ROOT)/ccache
CCACHE_CONFIG ?= $(RESOURCES_DIR)/manifests/package/ccache-configuration.json

# Sub-folder defines
LOGS_DIR ?= $(BUILD_DIR)/logs
CACHED_RPMS_DIR ?= $(BUILD_DIR)/rpm_cache
STATUS_FLAGS_DIR ?= $(BUILD_DIR)/make_status
CHROOT_DIR ?= $(BUILD_DIR)/worker/chroot
IMAGEGEN_DIR ?= $(BUILD_DIR)/imagegen
PROFILE_DIR ?= $(BUILD_DIR)/profile

IMAGES_DIR ?= $(OUT_DIR)/images

######## COMMON MAKEFILE UTILITIES ########

Expand All @@ -66,13 +26,11 @@ LOG_LEVEL ?= info
# always,auto,never
LOG_COLOR ?= auto
STOP_ON_WARNING ?= n
STOP_ON_PKG_FAIL ?= n
STOP_ON_FETCH_FAIL ?= n

######## HIGH LEVEL TARGETS ########

.PHONY: all clean
all: toolchain go-tools chroot-tools
all: go-tools

######## SUBMAKE INCLUDES ########

Expand All @@ -88,10 +46,6 @@ include $(SCRIPTS_DIR)/build_tag_imagecustomizer.mk
# go-tools, clean-go-tools, go-tidy-all (tidy go utilities before committing) go-test-coverage
include $(SCRIPTS_DIR)/tools.mk

# Create images with:
# image, iso, clean-imagegen
include $(SCRIPTS_DIR)/imggen.mk

##help:target:clean=Clean all built files.
# Each component provides specific clean implementations which clean depends on.
# They are guaranteed to run first and will verify there are no existing mount points
Expand Down
276 changes: 0 additions & 276 deletions toolkit/scripts/imggen.mk

This file was deleted.

9 changes: 0 additions & 9 deletions toolkit/scripts/utils.mk
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ endef

######## VARIABLE DEPENDENCY TRACKING ########

# List of variables to watch for changes.
watch_vars=PACKAGE_BUILD_LIST PACKAGE_REBUILD_LIST PACKAGE_IGNORE_LIST REPO_LIST CONFIG_FILE STOP_ON_PKG_FAIL TOOLCHAIN_ARCHIVE REBUILD_TOOLCHAIN SRPM_PACK_LIST SPECS_DIR MAX_CASCADING_REBUILDS RUN_CHECK TEST_RUN_LIST TEST_RERUN_LIST TEST_IGNORE_LIST EXTRA_BUILD_LAYERS LICENSE_CHECK_MODE VALIDATE_TOOLCHAIN_GPG REPO_SNAPSHOT_TIME
# Current list: $(depend_PACKAGE_BUILD_LIST) $(depend_PACKAGE_REBUILD_LIST) $(depend_PACKAGE_IGNORE_LIST) $(depend_REPO_LIST) $(depend_CONFIG_FILE) $(depend_STOP_ON_PKG_FAIL)
# $(depend_TOOLCHAIN_ARCHIVE) $(depend_REBUILD_TOOLCHAIN) $(depend_SRPM_PACK_LIST) $(depend_SPECS_DIR) $(depend_EXTRA_BUILD_LAYERS) $(depend_MAX_CASCADING_REBUILDS) $(depend_RUN_CHECK) $(depend_TEST_RUN_LIST)
# $(depend_TEST_RERUN_LIST) $(depend_TEST_IGNORE_LIST) $(depend_LICENSE_CHECK_MODE) $(depend_VALIDATE_TOOLCHAIN_GPG) $(depend_REPO_SNAPSHOT_TIME)

.PHONY: variable_depends_on_phony clean-variable_depends_on_phony setfacl_always_run_phony
clean: clean-variable_depends_on_phony

Expand Down Expand Up @@ -90,9 +84,6 @@ $(STATUS_FLAGS_DIR)/$1_tracking_flag: variable_depends_on_phony
fi
endef

# Invoke the above rule for each tracked variable
$(foreach var,$(watch_vars),$(eval $(call depend_on_var,$(var))))

# Host's ACLs influence the default permissions of the
# files inside the built RPMs. Disabling them for the repository.
#
Expand Down
Loading