Skip to content

Commit d11554c

Browse files
TiborGYmartin-frbg
authored andcommitted
Validate user supplied TARGET (#1941)
the build will now abort with an error message when an undefined build TARGET is named Fixes #1938
1 parent ed70418 commit d11554c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Makefile.system

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ endif
6565

6666
ifdef TARGET
6767
GETARCH_FLAGS := -DFORCE_$(TARGET)
68+
GETARCH_FLAGS += -DUSER_TARGET
6869
endif
6970

7071
# Force fallbacks for 32bit

getarch.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,10 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10681068

10691069
#ifndef FORCE
10701070

1071+
#ifdef USER_TARGET
1072+
#error "The TARGET specified on the command line or in Makefile.rule is not supported. Please choose a target from TargetList.txt"
1073+
#endif
1074+
10711075
#if defined(__powerpc__) || defined(__powerpc) || defined(powerpc) || \
10721076
defined(__PPC__) || defined(PPC) || defined(_POWER) || defined(__POWERPC__)
10731077
#ifndef POWER

0 commit comments

Comments
 (0)