version 1.1.1.1, 2008/06/03 10:38:45 |
version 1.1.1.1.2.1, 2008/08/13 17:12:28 |
|
|
# Makefile.inc - common make rules to build Prex |
# Makefile.inc - common make rules to build Prex |
# |
# |
|
|
|
# |
# Supported environment variables |
# Supported environment variables |
# |
# |
# SRCDIR ... Root directory of source tree |
# SRCDIR ... Root directory of source tree |
# ARCH ... Architecture name |
# ARCH ... Architecture name |
# PLATFORM ... Platform name |
# PLATFORM ... Platform name |
# NDEBUG ... 0 for debug, 1 for release (default: 0) |
# NDEBUG ... 0 for debug, 1 for release (default: 0) |
# LIBGCC_PATH ... Full path for libgcc.a |
# LIBGCC_PATH ... Directory for libgcc.a |
# CROSS_COMPILE ... Prefix of tools for cross compile |
# CROSS_COMPILE ... Prefix of tools for cross compile |
# |
# |
# Variables in local Makefile |
# Variables in local Makefile |
|
|
-D__ARCH__=$(ARCH) -D__PLATFORM__=$(PLATFORM) \ |
-D__ARCH__=$(ARCH) -D__PLATFORM__=$(PLATFORM) \ |
-U$(ARCH) -U$(PLATFORM) |
-U$(ARCH) -U$(PLATFORM) |
|
|
CFLAGS+= -Os -ansi -pedantic -fno-strict-aliasing \ |
CFLAGS+= -Os -ansi -pedantic -Wall -Wundef -fno-strict-aliasing \ |
-Wall -Wundef -Wstrict-prototypes -Wpointer-arith \ |
-Wstrict-prototypes -Wpointer-arith \ |
$(CONFIG_CFLAGS) $(DEFS) |
$(CONFIG_CFLAGS) $(DEFS) |
|
|
ifeq ($(NDEBUG),1) |
ifeq ($(NDEBUG),1) |
CFLAGS+= -fomit-frame-pointer |
CFLAGS+= -fomit-frame-pointer |
else |
else |
CFLAGS+= -fno-omit-frame-pointer -DDEBUG -g |
CFLAGS+= -fno-omit-frame-pointer -g |
|
DEFS+= -DDEBUG |
endif |
endif |
|
|
CPPFLAGS+= $(DEFS) |
CPPFLAGS+= $(DEFS) |
|
|
endif |
endif |
LDFLAGS+= |
LDFLAGS+= |
MAKEFLAGS+= -rR --no-print-directory |
MAKEFLAGS+= -rR --no-print-directory |
LINTFLAGS+= -D__lint__ $(DEFS) -nolib -weak -fcnuse -nestcomment \ |
LINTFLAGS+= -D__lint__ $(DEFS) -weak -nolib -retvalother -fcnuse |
-retvalother -fullinitblock |
|
|
|
# |
# |
# Specify path for libgcc.a |
# Specify path for libgcc.a |
|
|
|
|
-include Makefile.dep |
-include Makefile.dep |
|
|
C_SRCS = $(wildcard *.c) $(wildcard *.S) |
ifndef SRCS |
|
SRCS = $(OBJS:.o=.c) |
|
endif |
|
|
# |
# |
# Depend |
# Depend |
|
|
done); |
done); |
endif |
endif |
rm -f Makefile.dep |
rm -f Makefile.dep |
@(for d in $(C_SRCS) _ ; do \ |
@(for d in $(SRCS) _ ; do \ |
if [ "$$d" != "_" ] ; then \ |
if [ "$$d" != "_" ] ; then \ |
$(CPP) -M $(CPPFLAGS) $$d >> Makefile.dep; fi; \ |
$(CPP) -M $(CPPFLAGS) $$d >> Makefile.dep; fi; \ |
done); |
done); |
|
|
# |
# |
.PHONY: lint |
.PHONY: lint |
lint: |
lint: |
@(for d in $(C_SRCS) _ ; do \ |
ifdef SUBDIR |
|
@(for d in $(SUBDIR) _ ; do \ |
|
if [ "$$d" != "_" ] ; then $(MAKE) -C $$d lint; fi; \ |
|
done); |
|
endif |
|
@(for d in $(SRCS) _ ; do \ |
if [ "$$d" != "_" ] ; then \ |
if [ "$$d" != "_" ] ; then \ |
|
echo ; \ |
|
echo "Checking $$d" ; \ |
$(LINT) $(LINTFLAGS) $(INCLUDE) $$d; fi; \ |
$(LINT) $(LINTFLAGS) $(INCLUDE) $$d; fi; \ |
done); |
done); |
|
|