From 2838e418196885490b0ef659b70f75ce3e53038f Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Tue, 13 Nov 2018 12:42:35 -0800 Subject: [PATCH] Add defines for atmosphere git revision. --- exosphere/Makefile | 9 ++++++++- fusee/fusee-primary/Makefile | 9 ++++++++- fusee/fusee-secondary/Makefile | 9 ++++++++- stratosphere/boot/Makefile | 10 +++++++++- stratosphere/creport/Makefile | 9 ++++++++- stratosphere/fatal/Makefile | 9 ++++++++- stratosphere/fs_mitm/Makefile | 9 ++++++++- stratosphere/libstratosphere | 2 +- stratosphere/loader/Makefile | 9 ++++++++- stratosphere/pm/Makefile | 9 ++++++++- stratosphere/set_mitm/Makefile | 9 ++++++++- stratosphere/sm/Makefile | 9 ++++++++- thermosphere/Makefile | 8 ++++++++ 13 files changed, 98 insertions(+), 12 deletions(-) diff --git a/exosphere/Makefile b/exosphere/Makefile index efadefc58..11339bb05 100644 --- a/exosphere/Makefile +++ b/exosphere/Makefile @@ -9,6 +9,13 @@ endif TOPDIR ?= $(CURDIR) include $(DEVKITPRO)/devkitA64/base_rules +AMSBRANCH := $(shell git symbolic-ref --short HEAD) +AMSREV := $(AMSBRANCH)-$(shell git rev-parse --short HEAD) + +ifneq (, $(strip $(shell git status --porcelain 2>/dev/null))) + AMSREV := $(AMSREV)-dirty +endif + #--------------------------------------------------------------------------------- # TARGET is the name of the output # BUILD is the directory where object files & intermediate files will be placed @@ -26,7 +33,7 @@ INCLUDES := include ../common/include # options for code generation #--------------------------------------------------------------------------------- ARCH := -march=armv8-a -mtune=cortex-a57 -mgeneral-regs-only #<- important -DEFINES := -D__CCPLEX__ +DEFINES := -D__CCPLEX__ -DATMOSPHERE_GIT_BRANCH=\"$(AMSBRANCH)\" -DATMOSPHERE_GIT_REV=\"$(AMSREV)\" CFLAGS := \ -g \ -O2 \ diff --git a/fusee/fusee-primary/Makefile b/fusee/fusee-primary/Makefile index 8dce2efff..cf79835f8 100644 --- a/fusee/fusee-primary/Makefile +++ b/fusee/fusee-primary/Makefile @@ -9,6 +9,13 @@ endif TOPDIR ?= $(CURDIR) include $(DEVKITARM)/base_rules +AMSBRANCH := $(shell git symbolic-ref --short HEAD) +AMSREV := $(AMSBRANCH)-$(shell git rev-parse --short HEAD) + +ifneq (, $(strip $(shell git status --porcelain 2>/dev/null))) + AMSREV := $(AMSREV)-dirty +endif + #--------------------------------------------------------------------------------- # TARGET is the name of the output # BUILD is the directory where object files & intermediate files will be placed @@ -26,7 +33,7 @@ INCLUDES := include ../../common/include # options for code generation #--------------------------------------------------------------------------------- ARCH := -march=armv4t -mtune=arm7tdmi -mthumb -mthumb-interwork -DEFINES := -D__BPMP__ -DFUSEE_STAGE1_SRC +DEFINES := -D__BPMP__ -DFUSEE_STAGE1_SRC -DATMOSPHERE_GIT_BRANCH=\"$(AMSBRANCH)\" -DATMOSPHERE_GIT_REV=\"$(AMSREV)\" CFLAGS := \ -g \ diff --git a/fusee/fusee-secondary/Makefile b/fusee/fusee-secondary/Makefile index 9055bbf59..c2c849f4d 100644 --- a/fusee/fusee-secondary/Makefile +++ b/fusee/fusee-secondary/Makefile @@ -12,6 +12,13 @@ AMS := $(TOPDIR)/../../ include $(DEVKITARM)/base_rules +AMSBRANCH := $(shell git symbolic-ref --short HEAD) +AMSREV := $(AMSBRANCH)-$(shell git rev-parse --short HEAD) + +ifneq (, $(strip $(shell git status --porcelain 2>/dev/null))) + AMSREV := $(AMSREV)-dirty +endif + #--------------------------------------------------------------------------------- # TARGET is the name of the output # BUILD is the directory where object files & intermediate files will be placed @@ -29,7 +36,7 @@ INCLUDES := include ../../common/include # options for code generation #--------------------------------------------------------------------------------- ARCH := -march=armv4t -mtune=arm7tdmi -marm -DEFINES := -D__BPMP__ -DFUSEE_STAGE2_SRC +DEFINES := -D__BPMP__ -DFUSEE_STAGE2_SRC -DATMOSPHERE_GIT_BRANCH=\"$(AMSBRANCH)\" -DATMOSPHERE_GIT_REV=\"$(AMSREV)\" CFLAGS := \ -g \ diff --git a/stratosphere/boot/Makefile b/stratosphere/boot/Makefile index 57b69f6e0..7ea2668f3 100644 --- a/stratosphere/boot/Makefile +++ b/stratosphere/boot/Makefile @@ -9,6 +9,14 @@ endif TOPDIR ?= $(CURDIR) include $(DEVKITPRO)/libnx/switch_rules +AMSBRANCH := $(shell git symbolic-ref --short HEAD) +AMSREV := $(AMSBRANCH)-$(shell git rev-parse --short HEAD) + +ifneq (, $(strip $(shell git status --porcelain 2>/dev/null))) + AMSREV := $(AMSREV)-dirty +endif + + #--------------------------------------------------------------------------------- # TARGET is the name of the output # BUILD is the directory where object files & intermediate files will be placed @@ -24,7 +32,7 @@ DATA := data INCLUDES := include ../../common/include EXEFS_SRC := exefs_src -DEFINES := -DDISABLE_IPC +DEFINES := -DDISABLE_IPC -DATMOSPHERE_GIT_BRANCH=\"$(AMSBRANCH)\" -DATMOSPHERE_GIT_REV=\"$(AMSREV)\" #--------------------------------------------------------------------------------- # options for code generation diff --git a/stratosphere/creport/Makefile b/stratosphere/creport/Makefile index c042e968d..71c014dc5 100644 --- a/stratosphere/creport/Makefile +++ b/stratosphere/creport/Makefile @@ -9,6 +9,13 @@ endif TOPDIR ?= $(CURDIR) include $(DEVKITPRO)/libnx/switch_rules +AMSBRANCH := $(shell git symbolic-ref --short HEAD) +AMSREV := $(AMSBRANCH)-$(shell git rev-parse --short HEAD) + +ifneq (, $(strip $(shell git status --porcelain 2>/dev/null))) + AMSREV := $(AMSREV)-dirty +endif + #--------------------------------------------------------------------------------- # TARGET is the name of the output # BUILD is the directory where object files & intermediate files will be placed @@ -24,7 +31,7 @@ DATA := data INCLUDES := include ../../common/include EXEFS_SRC := exefs_src -DEFINES := -DDISABLE_IPC +DEFINES := -DDISABLE_IPC -DATMOSPHERE_GIT_BRANCH=\"$(AMSBRANCH)\" -DATMOSPHERE_GIT_REV=\"$(AMSREV)\" #--------------------------------------------------------------------------------- # options for code generation diff --git a/stratosphere/fatal/Makefile b/stratosphere/fatal/Makefile index 4fba60450..fbbe7ae9c 100644 --- a/stratosphere/fatal/Makefile +++ b/stratosphere/fatal/Makefile @@ -9,6 +9,13 @@ endif TOPDIR ?= $(CURDIR) include $(DEVKITPRO)/libnx/switch_rules +AMSBRANCH := $(shell git symbolic-ref --short HEAD) +AMSREV := $(AMSBRANCH)-$(shell git rev-parse --short HEAD) + +ifneq (, $(strip $(shell git status --porcelain 2>/dev/null))) + AMSREV := $(AMSREV)-dirty +endif + #--------------------------------------------------------------------------------- # TARGET is the name of the output # BUILD is the directory where object files & intermediate files will be placed @@ -24,7 +31,7 @@ DATA := data INCLUDES := include ../../common/include EXEFS_SRC := exefs_src -DEFINES := -DDISABLE_IPC +DEFINES := -DDISABLE_IPC -DATMOSPHERE_GIT_BRANCH=\"$(AMSBRANCH)\" -DATMOSPHERE_GIT_REV=\"$(AMSREV)\" #--------------------------------------------------------------------------------- # options for code generation diff --git a/stratosphere/fs_mitm/Makefile b/stratosphere/fs_mitm/Makefile index e8b1f047a..4ebc8f6d9 100644 --- a/stratosphere/fs_mitm/Makefile +++ b/stratosphere/fs_mitm/Makefile @@ -9,6 +9,13 @@ endif TOPDIR ?= $(CURDIR) include $(DEVKITPRO)/libnx/switch_rules +AMSBRANCH := $(shell git symbolic-ref --short HEAD) +AMSREV := $(AMSBRANCH)-$(shell git rev-parse --short HEAD) + +ifneq (, $(strip $(shell git status --porcelain 2>/dev/null))) + AMSREV := $(AMSREV)-dirty +endif + #--------------------------------------------------------------------------------- # TARGET is the name of the output # BUILD is the directory where object files & intermediate files will be placed @@ -24,7 +31,7 @@ DATA := data INCLUDES := include ../../common/include EXEFS_SRC := exefs_src -DEFINES := -DDISABLE_IPC +DEFINES := -DDISABLE_IPC -DATMOSPHERE_GIT_BRANCH=\"$(AMSBRANCH)\" -DATMOSPHERE_GIT_REV=\"$(AMSREV)\" #--------------------------------------------------------------------------------- # options for code generation diff --git a/stratosphere/libstratosphere b/stratosphere/libstratosphere index bcd80ab44..6a6eedeac 160000 --- a/stratosphere/libstratosphere +++ b/stratosphere/libstratosphere @@ -1 +1 @@ -Subproject commit bcd80ab445258c20d968aad1c083fd8cb0937bee +Subproject commit 6a6eedeacd69a4bddb1e43e31a642a1249a8eb88 diff --git a/stratosphere/loader/Makefile b/stratosphere/loader/Makefile index e8b1f047a..4ebc8f6d9 100644 --- a/stratosphere/loader/Makefile +++ b/stratosphere/loader/Makefile @@ -9,6 +9,13 @@ endif TOPDIR ?= $(CURDIR) include $(DEVKITPRO)/libnx/switch_rules +AMSBRANCH := $(shell git symbolic-ref --short HEAD) +AMSREV := $(AMSBRANCH)-$(shell git rev-parse --short HEAD) + +ifneq (, $(strip $(shell git status --porcelain 2>/dev/null))) + AMSREV := $(AMSREV)-dirty +endif + #--------------------------------------------------------------------------------- # TARGET is the name of the output # BUILD is the directory where object files & intermediate files will be placed @@ -24,7 +31,7 @@ DATA := data INCLUDES := include ../../common/include EXEFS_SRC := exefs_src -DEFINES := -DDISABLE_IPC +DEFINES := -DDISABLE_IPC -DATMOSPHERE_GIT_BRANCH=\"$(AMSBRANCH)\" -DATMOSPHERE_GIT_REV=\"$(AMSREV)\" #--------------------------------------------------------------------------------- # options for code generation diff --git a/stratosphere/pm/Makefile b/stratosphere/pm/Makefile index c3b31a855..766f33dd4 100644 --- a/stratosphere/pm/Makefile +++ b/stratosphere/pm/Makefile @@ -9,6 +9,13 @@ endif TOPDIR ?= $(CURDIR) include $(DEVKITPRO)/libnx/switch_rules +AMSBRANCH := $(shell git symbolic-ref --short HEAD) +AMSREV := $(AMSBRANCH)-$(shell git rev-parse --short HEAD) + +ifneq (, $(strip $(shell git status --porcelain 2>/dev/null))) + AMSREV := $(AMSREV)-dirty +endif + #--------------------------------------------------------------------------------- # TARGET is the name of the output # BUILD is the directory where object files & intermediate files will be placed @@ -24,7 +31,7 @@ DATA := data INCLUDES := include ../../common/include EXEFS_SRC := exefs_src -DEFINES := -DDISABLE_IPC +DEFINES := -DDISABLE_IPC -DATMOSPHERE_GIT_BRANCH=\"$(AMSBRANCH)\" -DATMOSPHERE_GIT_REV=\"$(AMSREV)\" #--------------------------------------------------------------------------------- # options for code generation diff --git a/stratosphere/set_mitm/Makefile b/stratosphere/set_mitm/Makefile index c042e968d..71c014dc5 100644 --- a/stratosphere/set_mitm/Makefile +++ b/stratosphere/set_mitm/Makefile @@ -9,6 +9,13 @@ endif TOPDIR ?= $(CURDIR) include $(DEVKITPRO)/libnx/switch_rules +AMSBRANCH := $(shell git symbolic-ref --short HEAD) +AMSREV := $(AMSBRANCH)-$(shell git rev-parse --short HEAD) + +ifneq (, $(strip $(shell git status --porcelain 2>/dev/null))) + AMSREV := $(AMSREV)-dirty +endif + #--------------------------------------------------------------------------------- # TARGET is the name of the output # BUILD is the directory where object files & intermediate files will be placed @@ -24,7 +31,7 @@ DATA := data INCLUDES := include ../../common/include EXEFS_SRC := exefs_src -DEFINES := -DDISABLE_IPC +DEFINES := -DDISABLE_IPC -DATMOSPHERE_GIT_BRANCH=\"$(AMSBRANCH)\" -DATMOSPHERE_GIT_REV=\"$(AMSREV)\" #--------------------------------------------------------------------------------- # options for code generation diff --git a/stratosphere/sm/Makefile b/stratosphere/sm/Makefile index dae1cae4a..a54a5a0d6 100644 --- a/stratosphere/sm/Makefile +++ b/stratosphere/sm/Makefile @@ -9,6 +9,13 @@ endif TOPDIR ?= $(CURDIR) include $(DEVKITPRO)/libnx/switch_rules +AMSBRANCH := $(shell git symbolic-ref --short HEAD) +AMSREV := $(AMSBRANCH)-$(shell git rev-parse --short HEAD) + +ifneq (, $(strip $(shell git status --porcelain 2>/dev/null))) + AMSREV := $(AMSREV)-dirty +endif + #--------------------------------------------------------------------------------- # TARGET is the name of the output # BUILD is the directory where object files & intermediate files will be placed @@ -24,7 +31,7 @@ DATA := data INCLUDES := include ../../common/include EXEFS_SRC := exefs_src -DEFINES := -DDISABLE_IPC +DEFINES := -DDISABLE_IPC -DATMOSPHERE_GIT_BRANCH=\"$(AMSBRANCH)\" -DATMOSPHERE_GIT_REV=\"$(AMSREV)\" #--------------------------------------------------------------------------------- # options for code generation diff --git a/thermosphere/Makefile b/thermosphere/Makefile index 76f6a100b..7f2634bbe 100644 --- a/thermosphere/Makefile +++ b/thermosphere/Makefile @@ -9,6 +9,13 @@ endif TOPDIR ?= $(CURDIR) include $(DEVKITPRO)/devkitA64/base_rules +AMSBRANCH := $(shell git symbolic-ref --short HEAD) +AMSREV := $(AMSBRANCH)-$(shell git rev-parse --short HEAD) + +ifneq (, $(strip $(shell git status --porcelain 2>/dev/null))) + AMSREV := $(AMSREV)-dirty +endif + #--------------------------------------------------------------------------------- # TARGET is the name of the output # BUILD is the directory where object files & intermediate files will be placed @@ -26,6 +33,7 @@ INCLUDES := include ../common/include # options for code generation #--------------------------------------------------------------------------------- ARCH := -march=armv8-a -mtune=cortex-a57 +DEFINES := -DATMOSPHERE_GIT_BRANCH=\"$(AMSBRANCH)\" -DATMOSPHERE_GIT_REV=\"$(AMSREV)\" CFLAGS := \ -g \