Skip to content

Commit

Permalink
common-rules.mk: Move common rules out of common.mk as multi-loop
Browse files Browse the repository at this point in the history
  • Loading branch information
th0ma7 committed Feb 6, 2024
1 parent 0b68841 commit 5619159
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 12 deletions.
13 changes: 13 additions & 0 deletions mk/spksrc.common-rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Common rules, shared by all makefiles

###

clean:
rm -fr work work-* build-*.log publish-*.log status-*.log

smart-clean:
rm -rf $(WORK_DIR)/$(PKG_DIR)
rm -f $(WORK_DIR)/.$(COOKIE_PREFIX)*

changelog:
git log --pretty=format:"- %s" -- $(PWD)
12 changes: 0 additions & 12 deletions mk/spksrc.common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@

###

clean:
rm -fr work work-* build-*.log publish-*.log status-*.log

smart-clean:
rm -rf $(WORK_DIR)/$(PKG_DIR)
rm -f $(WORK_DIR)/.$(COOKIE_PREFIX)*

changelog:
git log --pretty=format:"- %s" -- $(PWD)

###

# all will be the default target, regardless of what is defined in the other
# makefiles.
default: all
Expand Down
7 changes: 7 additions & 0 deletions mk/spksrc.native-env.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
###

### Include common rules
include ../../mk/spksrc.common-rules.mk

###

PKG_CONFIG_LIBDIR = $(INSTALL_DIR)/$(INSTALL_PREFIX)/lib/pkgconfig

INSTALL_DIR = $(WORK_DIR)/install
Expand Down
5 changes: 5 additions & 0 deletions mk/spksrc.supported.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
####

### Include common rules
include ../../mk/spksrc.common-rules.mk

###

# make all-supported
ifeq (supported,$(findstring supported,$(subst -, ,$(firstword $(MAKECMDGOALS)))))
TARGET_TYPE = supported
Expand Down
5 changes: 5 additions & 0 deletions mk/spksrc.tc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ include ../../mk/spksrc.directories.mk

include ../../mk/spksrc.common.mk

### Include common rules
include ../../mk/spksrc.common-rules.mk

include ../../mk/spksrc.cross-rust-env.mk

# Include cross-cmake-env.mk to generate its toolchain file
include ../../mk/spksrc.cross-cmake-env.mk

Expand Down

0 comments on commit 5619159

Please sign in to comment.