Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile
r1459 r1476 38 38 endif 39 39 40 # FIXME We have to differentiate between host and target OS architecture. 41 OS_ARCH ?= $(shell uname) 42 ifneq ($(OS_ARCH), SunOS) 40 # HOST_OS is only used to work around local toolchain issues. 41 HOST_OS ?= $(shell uname) 42 ifeq ($(HOST_OS), MINGW32_NT-5.1) 43 # Explicitly set CC = gcc on MinGW, otherwise: "cc: command not found". 44 CC = gcc 45 endif 46 ifneq ($(HOST_OS), SunOS) 43 47 STRIP_ARGS = -s 44 48 endif 45 ifeq ($(OS_ARCH), Darwin) 49 50 # Determine the destination processor architecture. 51 # IMPORTANT: The following line must be placed before TARGET_OS is ever used 52 # (of course), but should come after any lines setting CC because the line 53 # below uses CC itself. 54 override TARGET_OS := $(strip $(shell LC_ALL=C $(CC) $(CPPFLAGS) -E os.h 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"')) 55 56 ifeq ($(TARGET_OS), Darwin) 46 57 CPPFLAGS += -I/opt/local/include -I/usr/local/include 47 58 # DirectHW framework can be found in the DirectHW library. 48 59 LDFLAGS += -framework IOKit -framework DirectHW -L/opt/local/lib -L/usr/local/lib 49 60 endif 50 ifeq ($( OS_ARCH), FreeBSD)61 ifeq ($(TARGET_OS), FreeBSD) 51 62 CPPFLAGS += -I/usr/local/include 52 63 LDFLAGS += -L/usr/local/lib 53 64 endif 54 ifeq ($( OS_ARCH), OpenBSD)65 ifeq ($(TARGET_OS), OpenBSD) 55 66 CPPFLAGS += -I/usr/local/include 56 67 LDFLAGS += -L/usr/local/lib 57 68 endif 58 ifeq ($( OS_ARCH), DOS)69 ifeq ($(TARGET_OS), DOS) 59 70 EXEC_SUFFIX := .exe 60 71 CPPFLAGS += -I../libgetopt -I../libpci/include 72 # DJGPP has odd uint*_t definitions which cause lots of format string warnings. 73 CPPFLAGS += -Wno-format 61 74 # FIXME Check if we can achieve the same effect with -L../libgetopt -lgetopt 62 75 LIBS += ../libgetopt/libgetopt.a … … 85 98 endif 86 99 87 ifeq ($(OS_ARCH), MINGW32_NT-5.1) 88 # Explicitly set CC = gcc on MinGW, otherwise: "cc: command not found". 89 CC = gcc 100 # FIXME: Should we check for Cygwin/MSVC as well? 101 ifeq ($(TARGET_OS), MinGW) 102 EXEC_SUFFIX := .exe 90 103 # MinGW doesn't have the ffs() function, but we can use gcc's __builtin_ffs(). 91 104 CFLAGS += -Dffs=__builtin_ffs … … 167 180 endif 168 181 169 ifeq ($(OS_ARCH), libpayload) 170 CC:=CC=i386-elf-gcc lpgcc 171 AR:=i386-elf-ar 172 RANLIB:=i386-elf-ranlib 182 ifeq ($(TARGET_OS), libpayload) 173 183 CPPFLAGS += -DSTANDALONE 174 184 ifeq ($(CONFIG_DUMMY), yes) … … 203 213 # IMPORTANT: The following line must be placed before ARCH is ever used 204 214 # (of course), but should come after any lines setting CC because the line 205 # below uses CC itself. In some cases we set CC based on OS_ARCH, see above.206 override ARCH := $(strip $(shell LC_ALL=C $(CC) -E arch.h 2>/dev/null | grep -v '^\#'))207 208 ifeq ($(ARCH), "ppc")215 # below uses CC itself. 216 override ARCH := $(strip $(shell LC_ALL=C $(CC) $(CPPFLAGS) -E arch.h 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"')) 217 218 ifeq ($(ARCH), ppc) 209 219 # There's no PCI port I/O support on PPC/PowerPC, yet. 210 220 ifeq ($(CONFIG_NIC3COM), yes) … … 349 359 FEATURE_CFLAGS += -D'CONFIG_INTERNAL=1' 350 360 PROGRAMMER_OBJS += processor_enable.o chipset_enable.o board_enable.o cbtable.o dmi.o internal.o 351 ifeq ($(ARCH), "x86")361 ifeq ($(ARCH), x86) 352 362 PROGRAMMER_OBJS += it87spi.o it85spi.o sb600spi.o wbsio_spi.o mcp6x_spi.o 353 363 PROGRAMMER_OBJS += ichspi.o ich_descriptors.o … … 477 487 478 488 ifeq ($(NEED_NET), yes) 479 ifeq ($( OS_ARCH), SunOS)489 ifeq ($(TARGET_OS), SunOS) 480 490 LIBS += -lsocket 481 491 endif … … 486 496 FEATURE_CFLAGS += -D'NEED_PCI=1' 487 497 PROGRAMMER_OBJS += pcidev.o physmap.o hwaccess.o 488 ifeq ($( OS_ARCH), NetBSD)498 ifeq ($(TARGET_OS), NetBSD) 489 499 # The libpci we want is called libpciutils on NetBSD and needs NetBSD libpci. 490 500 LIBS += -lpciutils -lpci … … 492 502 LIBS += -l$(shell uname -p) 493 503 else 494 ifeq ($( OS_ARCH), DOS)504 ifeq ($(TARGET_OS), DOS) 495 505 # FIXME There needs to be a better way to do this 496 506 LIBS += ../libpci/lib/libpci.a 497 507 else 498 508 LIBS += -lpci 499 ifeq ($( OS_ARCH), OpenBSD)509 ifeq ($(TARGET_OS), OpenBSD) 500 510 # For (i386|amd64)_iopl(2). 501 511 LIBS += -l$(shell uname -m) … … 565 575 rm -f .test.c .test$(EXEC_SUFFIX); exit 1) 566 576 @rm -f .test.c .test$(EXEC_SUFFIX) 567 @printf " ARCHis "577 @printf "Target arch is " 568 578 @# FreeBSD wc will output extraneous whitespace. 569 @echo $(ARCH)|wc - l|grep -q '^[[:blank:]]*1[[:blank:]]*$$' || \579 @echo $(ARCH)|wc -w|grep -q '^[[:blank:]]*1[[:blank:]]*$$' || \ 570 580 ( echo "unknown. Aborting."; exit 1) 571 581 @printf "%s\n" '$(ARCH)' 582 @printf "Target OS is " 583 @# FreeBSD wc will output extraneous whitespace. 584 @echo $(TARGET_OS)|wc -w|grep -q '^[[:blank:]]*1[[:blank:]]*$$' || \ 585 ( echo "unknown. Aborting."; exit 1) 586 @printf "%s\n" '$(TARGET_OS)' 572 587 573 588 define LIBPCI_TEST … … 685 700 686 701 djgpp-dos: clean 687 make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip WARNERROR=no OS_ARCH=DOS 702 make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip 703 libpayload: clean 704 make CC="CC=i386-elf-gcc lpgcc" AR=i386-elf-ar RANLIB=i386-elf-ranlib 688 705 689 706 .PHONY: all clean distclean compiler pciutils features export tarball dos featuresavailable
Note: See TracChangeset
for help on using the changeset viewer.
