=================================================================== RCS file: /cvs/prex-old/mk/Makefile.inc,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.2 diff -u -r1.1.1.1 -r1.1.1.1.2.2 --- prex-old/mk/Makefile.inc 2008/06/03 10:38:45 1.1.1.1 +++ prex-old/mk/Makefile.inc 2008/08/15 14:18:57 1.1.1.1.2.2 @@ -2,13 +2,14 @@ # Makefile.inc - common make rules to build Prex # +# # Supported environment variables # # SRCDIR ... Root directory of source tree # ARCH ... Architecture name # PLATFORM ... Platform name # 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 # # Variables in local Makefile @@ -47,7 +48,7 @@ OBJDUMP= $(CROSS_COMPILE)objdump STRIP= $(CROSS_COMPILE)strip LINT= splint -MAKE= make +MAKE= gmake #SHELL= /bin/sh ifdef SHELL_PATH SHELL= $(SHELL_PATH) @@ -68,14 +69,15 @@ -D__ARCH__=$(ARCH) -D__PLATFORM__=$(PLATFORM) \ -U$(ARCH) -U$(PLATFORM) -CFLAGS+= -Os -ansi -pedantic -fno-strict-aliasing \ - -Wall -Wundef -Wstrict-prototypes -Wpointer-arith \ +CFLAGS+= -Os -ansi -pedantic -Wall -Wundef -fno-strict-aliasing \ + -Wstrict-prototypes -Wpointer-arith \ $(CONFIG_CFLAGS) $(DEFS) ifeq ($(NDEBUG),1) CFLAGS+= -fomit-frame-pointer else -CFLAGS+= -fno-omit-frame-pointer -DDEBUG -g +CFLAGS+= -fno-omit-frame-pointer -g +DEFS+= -DDEBUG endif CPPFLAGS+= $(DEFS) @@ -85,8 +87,7 @@ endif LDFLAGS+= MAKEFLAGS+= -rR --no-print-directory -LINTFLAGS+= -D__lint__ $(DEFS) -nolib -weak -fcnuse -nestcomment \ - -retvalother -fullinitblock +LINTFLAGS+= -D__lint__ $(DEFS) -weak -nolib -retvalother -fcnuse # # Specify path for libgcc.a @@ -234,7 +235,9 @@ -include Makefile.dep -C_SRCS = $(wildcard *.c) $(wildcard *.S) +ifndef SRCS +SRCS = $(OBJS:.o=.c) +endif # # Depend @@ -247,7 +250,7 @@ done); endif rm -f Makefile.dep - @(for d in $(C_SRCS) _ ; do \ + @(for d in $(SRCS) _ ; do \ if [ "$$d" != "_" ] ; then \ $(CPP) -M $(CPPFLAGS) $$d >> Makefile.dep; fi; \ done); @@ -256,8 +259,15 @@ # .PHONY: 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 \ + echo ; \ + echo "Checking $$d" ; \ $(LINT) $(LINTFLAGS) $(INCLUDE) $$d; fi; \ done);