diff options
author | Eric Andersen <andersen@codepoet.org> | 2003-10-30 07:48:38 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2003-10-30 07:48:38 +0000 |
commit | b8b6816f7b0aa20e1e08e0881f4a428ccd76850e (patch) | |
tree | abb0ffca9413e2014fb4d3289388d946840e8e7b | |
parent | f4fd3a13318f15d212d5519516db50f572f08ada (diff) | |
download | busybox-w32-b8b6816f7b0aa20e1e08e0881f4a428ccd76850e.tar.gz busybox-w32-b8b6816f7b0aa20e1e08e0881f4a428ccd76850e.tar.bz2 busybox-w32-b8b6816f7b0aa20e1e08e0881f4a428ccd76850e.zip |
make certain values specified in the environment always win
-rw-r--r-- | Rules.mak | 24 |
1 files changed, 11 insertions, 13 deletions
@@ -34,23 +34,23 @@ BUILDTIME := $(shell TZ=UTC date -u "+%Y.%m.%d-%H:%M%z") | |||
34 | # to something more interesting... Target architecture is determined | 34 | # to something more interesting... Target architecture is determined |
35 | # by asking the CC compiler what arch it compiles things for, so unless | 35 | # by asking the CC compiler what arch it compiles things for, so unless |
36 | # your compiler is broken, you should not need to specify TARGET_ARCH | 36 | # your compiler is broken, you should not need to specify TARGET_ARCH |
37 | CROSS =$(subst ",, $(strip $(CROSS_COMPILER_PREFIX))) | 37 | CROSS ?=$(subst ",, $(strip $(CROSS_COMPILER_PREFIX))) |
38 | #CROSS =/usr/i386-linux-uclibc/bin/i386-uclibc- | 38 | #CROSS =/usr/i386-linux-uclibc/bin/i386-uclibc- |
39 | CC = $(CROSS)gcc | 39 | CC ?= $(CROSS)gcc |
40 | AR = $(CROSS)ar | 40 | AR ?= $(CROSS)ar |
41 | AS = $(CROSS)as | 41 | AS ?= $(CROSS)as |
42 | LD = $(CROSS)ld | 42 | LD ?= $(CROSS)ld |
43 | NM = $(CROSS)nm | 43 | NM ?= $(CROSS)nm |
44 | STRIP = $(CROSS)strip | 44 | STRIP ?= $(CROSS)strip |
45 | CPP = $(CC) -E | 45 | CPP ?= $(CC) -E |
46 | MAKEFILES = $(TOPDIR).config | 46 | MAKEFILES = $(TOPDIR).config |
47 | 47 | ||
48 | # What OS are you compiling busybox for? This allows you to include | 48 | # What OS are you compiling busybox for? This allows you to include |
49 | # OS specific things, syscall overrides, etc. | 49 | # OS specific things, syscall overrides, etc. |
50 | TARGET_OS=linux | 50 | TARGET_OS?=linux |
51 | 51 | ||
52 | # Select the compiler needed to build binaries for your development system | 52 | # Select the compiler needed to build binaries for your development system |
53 | HOSTCC = gcc | 53 | HOSTCC ?= gcc |
54 | HOSTCFLAGS= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer | 54 | HOSTCFLAGS= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer |
55 | 55 | ||
56 | # Ensure consistent sort order, 'gcc -print-search-dirs' behavior, etc. | 56 | # Ensure consistent sort order, 'gcc -print-search-dirs' behavior, etc. |
@@ -86,8 +86,7 @@ ARFLAGS=-r | |||
86 | 86 | ||
87 | #-------------------------------------------------------- | 87 | #-------------------------------------------------------- |
88 | export VERSION BUILDTIME TOPDIR HOSTCC HOSTCFLAGS CROSS CC AR AS LD NM STRIP CPP | 88 | export VERSION BUILDTIME TOPDIR HOSTCC HOSTCFLAGS CROSS CC AR AS LD NM STRIP CPP |
89 | ifeq ($(strip $(TARGET_ARCH)),) | 89 | TARGET_ARCH?=$(shell $(CC) -dumpmachine | sed -e s'/-.*//' \ |
90 | TARGET_ARCH=$(shell $(CC) -dumpmachine | sed -e s'/-.*//' \ | ||
91 | -e 's/i.86/i386/' \ | 90 | -e 's/i.86/i386/' \ |
92 | -e 's/sparc.*/sparc/' \ | 91 | -e 's/sparc.*/sparc/' \ |
93 | -e 's/arm.*/arm/g' \ | 92 | -e 's/arm.*/arm/g' \ |
@@ -99,7 +98,6 @@ TARGET_ARCH=$(shell $(CC) -dumpmachine | sed -e s'/-.*//' \ | |||
99 | -e 's/mipsel-.*/mipsel/' \ | 98 | -e 's/mipsel-.*/mipsel/' \ |
100 | -e 's/cris.*/cris/' \ | 99 | -e 's/cris.*/cris/' \ |
101 | ) | 100 | ) |
102 | endif | ||
103 | 101 | ||
104 | # Pull in the user's busybox configuration | 102 | # Pull in the user's busybox configuration |
105 | ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) | 103 | ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) |