Improved make.rules files

The make.rules of net-snk now uses the rules of the main make.rules file, too,
so that it is not necessary anymore to configure everything twice.
Also replaced the non-intuitive NEW_BUILD variable with the simply "V" flag
variable, so that you can now type "make V=x" with x being either 0, 1 or 2
for controlling the verbosity level of the build process.
Finally I also replaced the "echo -e" constructs with printfs since "echo -e"
is not POSIX compliant and and thus does not work other shells than bash.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
This commit is contained in:
Thomas Huth 2011-02-02 15:21:44 +01:00
parent 39426bad55
commit 28c890f369
2 changed files with 39 additions and 43 deletions

View File

@ -10,41 +10,17 @@
# * IBM Corporation - initial implementation
# ****************************************************************************/
CROSS ?= powerpc64-linux-
HOSTCC ?= gcc
HOSTCFLAGS = -g -Wall -W -O2 -I. -I../include
ROOTDIR ?= $(TOP)/../..
include $(ROOTDIR)/make.rules
INCLCMNDIR ?= $(ROOTDIR)/include
LIBCMNDIR ?= $(ROOTDIR)/lib
CFLAGS = -g -I. -I$(TOP)/include -I$(LIBCMNDIR)/libc/include \
-I$(LIBCMNDIR)/libbootmsg -I$(INCLCMNDIR)/$(CPUARCH) \
-O2 -fno-builtin -ffreestanding -msoft-float -mno-altivec \
-Wall $(FLAG) -nostdinc -fno-stack-protector
ifeq ($(SNK_LJTAG_PROCESS), 1)
CFLAGS += -I$(TOP)/../../board-malta/include
CFLAGS += -I$(TOP)/../../include/cbea
endif
LDFLAGS = -nostdlib
ASFLAGS = -I. -I$(TOP)/include -Wa,-mregnames -I$(INCLCMNDIR)/$(CPUARCH)
DD = dd
ifdef NEW_BUILD
MAKEFLAGS = --silent
CC = echo -e "\t[CC]\t$(DIRECTORY)$@"; $(CROSS)gcc -m64
AS = echo -e "\t[AS]\t$(DIRECTORY)$@"; $(CROSS)as -m64
LD = echo -e "\t[LD]\t$(DIRECTORY)$@"; $(CROSS)ld -melf64ppc
CLEAN = echo -e "\t[CLEAN]\t$(DIRECTORY)$$dir"
else
CC = $(CROSS)gcc -m64
AS = $(CROSS)as -m64
LD = $(CROSS)ld -melf64ppc
CLEAN = echo -n
endif
OBJCOPY = $(CROSS)objcopy
OBJDUMP = $(CROSS)objdump
STRIP = $(CROSS)strip
AR = $(CROSS)ar
RANLIB = $(CROSS)ranlib

View File

@ -14,32 +14,52 @@
# BUILD ENV SETTINGS
#############################################################################
# CROSS is the prefix of your cross-compiler.
# You can override this variable in your environment (export CROSS=...).
CROSS ?= powerpc64-linux-
CELLSIZE ?= 64
HOSTCC ?= gcc
HOSTCFLAGS = -g -Wall -W -O2 -I. -I../include
DD = dd
ONLY_LD = $(CROSS)ld -melf$(CELLSIZE)ppc
ifdef NEW_BUILD
MAKEFLAGS = --silent
CC = echo -e "\t[CC]\t$(DIRECTORY)$@"; $(CROSS)gcc -m$(CELLSIZE)
AS = echo -e "\t[AS]\t$(DIRECTORY)$@"; $(CROSS)as -m$(CELLSIZE)
LD = echo -e "\t[LD]\t$(DIRECTORY)$@"; $(ONLY_LD)
CLEAN = echo -e "\t[CLEAN]\t$(DIRECTORY)$$dir"
else
CC = $(CROSS)gcc -m$(CELLSIZE)
AS = $(CROSS)as -m$(CELLSIZE)
LD = $(ONLY_LD)
CLEAN = echo -n
ONLY_CC = $(CROSS)gcc -m$(CELLSIZE)
ONLY_AS = $(CROSS)as -m$(CELLSIZE)
ONLY_LD = $(CROSS)ld -melf$(CELLSIZE)ppc
# Verbose level:
# V=0 means completely silent
# V=1 means brief output
# V=2 means full output
V ?= 1
ifeq ($(V),0)
Q := @
MAKEFLAGS += --silent
MAKE += -s
endif
OBJCOPY ?= $(CROSS)objcopy
OBJDUMP ?= $(CROSS)objdump
STRIP ?= $(CROSS)strip
ifeq ($(V),1)
MAKEFLAGS += --silent
MAKE += -s
CC = printf "\t[CC]\t%s\n" `basename "$@"`; $(ONLY_CC)
AS = printf "\t[AS]\t%s\n" `basename "$@"`; $(ONLY_AS)
LD = printf "\t[LD]\t%s\n" `basename "$@"`; $(ONLY_LD)
CLEAN = printf "\t[CLEAN]\t%s\n" "$(DIRECTORY)$$dir"
else
CC = $(ONLY_CC)
AS = $(ONLY_AS)
LD = $(ONLY_LD)
CLEAN = echo -n
endif
OBJCOPY ?= $(CROSS)objcopy
OBJDUMP ?= $(CROSS)objdump
STRIP ?= $(CROSS)strip
AR ?= $(CROSS)ar
RANLIB ?= $(CROSS)ranlib
CPP ?= $(CROSS)cpp
CFLAGS ?= -g -O2 -fno-builtin -ffreestanding -nostdinc -msoft-float \
-mno-altivec -mabi=no-altivec -Wall -fno-stack-protector