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:
parent
39426bad55
commit
28c890f369
|
@ -10,41 +10,17 @@
|
||||||
# * IBM Corporation - initial implementation
|
# * IBM Corporation - initial implementation
|
||||||
# ****************************************************************************/
|
# ****************************************************************************/
|
||||||
|
|
||||||
CROSS ?= powerpc64-linux-
|
|
||||||
|
|
||||||
HOSTCC ?= gcc
|
|
||||||
HOSTCFLAGS = -g -Wall -W -O2 -I. -I../include
|
|
||||||
|
|
||||||
ROOTDIR ?= $(TOP)/../..
|
ROOTDIR ?= $(TOP)/../..
|
||||||
|
|
||||||
|
include $(ROOTDIR)/make.rules
|
||||||
|
|
||||||
INCLCMNDIR ?= $(ROOTDIR)/include
|
INCLCMNDIR ?= $(ROOTDIR)/include
|
||||||
LIBCMNDIR ?= $(ROOTDIR)/lib
|
LIBCMNDIR ?= $(ROOTDIR)/lib
|
||||||
CFLAGS = -g -I. -I$(TOP)/include -I$(LIBCMNDIR)/libc/include \
|
CFLAGS = -g -I. -I$(TOP)/include -I$(LIBCMNDIR)/libc/include \
|
||||||
-I$(LIBCMNDIR)/libbootmsg -I$(INCLCMNDIR)/$(CPUARCH) \
|
-I$(LIBCMNDIR)/libbootmsg -I$(INCLCMNDIR)/$(CPUARCH) \
|
||||||
-O2 -fno-builtin -ffreestanding -msoft-float -mno-altivec \
|
-O2 -fno-builtin -ffreestanding -msoft-float -mno-altivec \
|
||||||
-Wall $(FLAG) -nostdinc -fno-stack-protector
|
-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
|
LDFLAGS = -nostdlib
|
||||||
ASFLAGS = -I. -I$(TOP)/include -Wa,-mregnames -I$(INCLCMNDIR)/$(CPUARCH)
|
ASFLAGS = -I. -I$(TOP)/include -Wa,-mregnames -I$(INCLCMNDIR)/$(CPUARCH)
|
||||||
DD = dd
|
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
|
|
||||||
|
|
50
make.rules
50
make.rules
|
@ -14,32 +14,52 @@
|
||||||
# BUILD ENV SETTINGS
|
# BUILD ENV SETTINGS
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
|
# CROSS is the prefix of your cross-compiler.
|
||||||
|
# You can override this variable in your environment (export CROSS=...).
|
||||||
CROSS ?= powerpc64-linux-
|
CROSS ?= powerpc64-linux-
|
||||||
|
|
||||||
CELLSIZE ?= 64
|
CELLSIZE ?= 64
|
||||||
|
|
||||||
HOSTCC ?= gcc
|
HOSTCC ?= gcc
|
||||||
HOSTCFLAGS = -g -Wall -W -O2 -I. -I../include
|
HOSTCFLAGS = -g -Wall -W -O2 -I. -I../include
|
||||||
DD = dd
|
DD = dd
|
||||||
ONLY_LD = $(CROSS)ld -melf$(CELLSIZE)ppc
|
|
||||||
|
|
||||||
ifdef NEW_BUILD
|
ONLY_CC = $(CROSS)gcc -m$(CELLSIZE)
|
||||||
MAKEFLAGS = --silent
|
ONLY_AS = $(CROSS)as -m$(CELLSIZE)
|
||||||
CC = echo -e "\t[CC]\t$(DIRECTORY)$@"; $(CROSS)gcc -m$(CELLSIZE)
|
ONLY_LD = $(CROSS)ld -melf$(CELLSIZE)ppc
|
||||||
AS = echo -e "\t[AS]\t$(DIRECTORY)$@"; $(CROSS)as -m$(CELLSIZE)
|
|
||||||
LD = echo -e "\t[LD]\t$(DIRECTORY)$@"; $(ONLY_LD)
|
# Verbose level:
|
||||||
CLEAN = echo -e "\t[CLEAN]\t$(DIRECTORY)$$dir"
|
# V=0 means completely silent
|
||||||
else
|
# V=1 means brief output
|
||||||
CC = $(CROSS)gcc -m$(CELLSIZE)
|
# V=2 means full output
|
||||||
AS = $(CROSS)as -m$(CELLSIZE)
|
V ?= 1
|
||||||
LD = $(ONLY_LD)
|
|
||||||
CLEAN = echo -n
|
ifeq ($(V),0)
|
||||||
|
Q := @
|
||||||
|
MAKEFLAGS += --silent
|
||||||
|
MAKE += -s
|
||||||
endif
|
endif
|
||||||
|
|
||||||
OBJCOPY ?= $(CROSS)objcopy
|
ifeq ($(V),1)
|
||||||
OBJDUMP ?= $(CROSS)objdump
|
MAKEFLAGS += --silent
|
||||||
STRIP ?= $(CROSS)strip
|
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
|
AR ?= $(CROSS)ar
|
||||||
RANLIB ?= $(CROSS)ranlib
|
RANLIB ?= $(CROSS)ranlib
|
||||||
|
CPP ?= $(CROSS)cpp
|
||||||
|
|
||||||
CFLAGS ?= -g -O2 -fno-builtin -ffreestanding -nostdinc -msoft-float \
|
CFLAGS ?= -g -O2 -fno-builtin -ffreestanding -nostdinc -msoft-float \
|
||||||
-mno-altivec -mabi=no-altivec -Wall -fno-stack-protector
|
-mno-altivec -mabi=no-altivec -Wall -fno-stack-protector
|
||||||
|
|
Loading…
Reference in New Issue