X-Git-Url: https://git.saurik.com/apple/ld64.git/blobdiff_plain/d696c285d331ab577dcabd00419d8c30336673da..HEAD:/unit-tests/test-cases/auto-arch/Makefile diff --git a/unit-tests/test-cases/auto-arch/Makefile b/unit-tests/test-cases/auto-arch/Makefile index e5caa64..4382cc1 100644 --- a/unit-tests/test-cases/auto-arch/Makefile +++ b/unit-tests/test-cases/auto-arch/Makefile @@ -1,5 +1,5 @@ ## -# Copyright (c) 2006 Apple Computer, Inc. All rights reserved. +# Copyright (c) 2006-2007 Apple Inc. All rights reserved. # # @APPLE_LICENSE_HEADER_START@ # @@ -23,23 +23,31 @@ TESTROOT = ../.. include ${TESTROOT}/include/common.makefile -SHELL = bash # use bash shell so we can redirect just stderr +ifeq ($(FILEARCH),arm) + LD_VERS = -ios_version_min 4.0 -syslibroot $(IOS_SDK) + CC_VERS = -miphoneos-version-min=4.0 +else +ifeq ($(FILEARCH),arm64) + LD_VERS = -ios_version_min 4.0 -syslibroot $(IOS_SDK) + CC_VERS = -miphoneos-version-min=4.0 +else + LD_VERS = -macosx_version_min 10.6 + CC_VERS = -mmacosx-version-min=10.6 +endif +endif + # -# The point of this test is a check that ld -# can figure out which architecture is needed -# by looking at the .o files when -arch is not used. +# Check that ld can figure out architecture from .o files without -arch option # run: all all: - ${CC} ${CCFLAGS} hello.c -c -o hello.o -mmacosx-version-min=10.4 - ${LD} -lcrt1.o hello.o -o hello -lSystem 2> fail.log - ${FAIL_IF_BAD_MACHO} hello - file hello | grep ${ARCH} | ${PASS_IFF_STDIN} + ${CC} ${CC_VERS} ${CCFLAGS} hello.c -c -o hello.o + ${FAIL_IF_BAD_OBJ} hello.o + ${LD} ${LDFLAGS} hello.o -dylib -o hello.dylib -lSystem $(LD_VERS) + file hello.dylib | grep ${FILEARCH} | ${PASS_IFF_STDIN} clean: - rm hello.o hello fail.log - - + rm -rf hello.o hello.dylib