From: Thiemo S. <th...@ne...> - 2005-05-13 19:33:29
|
Hello All, the appended patch fixes some insufficiencies of the runtime makefile(s), namely the handling of dependencies, which is now done automatically. The changelog in more detail: - Add automatic dependency handling - Use wildcard instead of unprotected * pattern - Build os-common.o from the main makefile - Sort SRCS/C_SRC/ASSEM_SRC/OBJS/LIBS in a more coherent way - Avoid useless replication of default values in Config files - Add the boilerplate text where it was missing - Use linux-nm for linux configurations - Unify OS_LINK_FLAGS and LINKFLAGS Potential problems: - The dependency handling assumes $(CC) -MM to work. This may not work for non-gcc compilers. OTOH the old version already assumed $(CC) -M, which has AFAIK the same problem. - For ppc-darwin, the -no-cpp-precomp flag was moved from CPP and CFLAGS to CPPFLAGS. This should continue to work, but I haven't tested it. This also means the small helper binaries are now also compiled with -no-cpp-precomp. - For the sparc configurations, ldso-stubs.S moved from ARCH_SRC to ASSEM_SRC. This shouldn't change anything for CVS, but might break local patches. Generally, this patch has seen little testing yet, please try if it still works on your platform. I haven't changed the build scripts to use those improvements, mainly because ppc-darwin has a comment which mentions it will fail with less than a full rebuild of the C source. Thiemo Index: Config.alpha-linux =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/Config.alpha-linux,v retrieving revision 1.6 diff -u -p -r1.6 Config.alpha-linux --- Config.alpha-linux 21 Feb 2003 16:24:30 -0000 1.6 +++ Config.alpha-linux 13 May 2005 19:03:54 -0000 @@ -1,3 +1,5 @@ +# -*- makefile -*- for the C-level run-time support for SBCL + # This software is part of the SBCL system. See the README file for # more information. # @@ -9,14 +11,13 @@ CFLAGS += -Dalpha LD = ld -taso -LINKFLAGS = -dynamic -v -g -Wl,-T -Wl,ld-script.alpha-linux -NM = nm -p +LINKFLAGS += -dynamic -v -Wl,-T -Wl,ld-script.alpha-linux -rdynamic +NM = ./linux-nm ASSEM_SRC = alpha-assem.S ldso-stubs.S ARCH_SRC = alpha-arch.c -OS_SRC = linux-os.c alpha-linux-os.c os-common.c -LINKFLAGS+=-rdynamic # -static -OS_LIBS= -ldl +OS_SRC = linux-os.c alpha-linux-os.c +OS_LIBS = -ldl -GC_SRC= cheneygc.c +GC_SRC = cheneygc.c Index: Config.alpha-osf1 =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/Config.alpha-osf1,v retrieving revision 1.5 diff -u -p -r1.5 Config.alpha-osf1 --- Config.alpha-osf1 10 Aug 2004 00:20:46 -0000 1.5 +++ Config.alpha-osf1 13 May 2005 19:03:54 -0000 @@ -1,3 +1,5 @@ +# -*- makefile -*- for the C-level run-time support for SBCL + # This software is part of the SBCL system. See the README file for # more information. # @@ -30,7 +32,10 @@ ARCH_SRC = alpha-arch.c undefineds.c %.s:%.S cp $^ $@ -OS_SRC = osf1-os.c alpha-osf1-os.c os-common.c -OS_LIBS= #-ldl +# ... and let the main makefile clean the .s properly. +OS_CLEAN_FILES += $(ASSEM_SRC) + +OS_SRC = osf1-os.c alpha-osf1-os.c +OS_LIBS = #-ldl -GC_SRC= cheneygc.c +GC_SRC = cheneygc.c Index: Config.hppa-linux =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/Config.hppa-linux,v retrieving revision 1.1 diff -u -p -r1.1 Config.hppa-linux --- Config.hppa-linux 19 Aug 2002 12:14:02 -0000 1.1 +++ Config.hppa-linux 13 May 2005 19:03:54 -0000 @@ -1,3 +1,5 @@ +# -*- makefile -*- for the C-level run-time support for SBCL + # This software is part of the SBCL system. See the README file for # more information. # @@ -7,16 +9,14 @@ # provided with absolutely no warranty. See the COPYING and CREDITS # files for more information. -CFLAGS += -g -Dhppa -LD = ld -LINKFLAGS = -v -g -NM = nm -p +CFLAGS += -Dhppa +LINKFLAGS += -v -static +NM = ./linux-nm ASSEM_SRC = hppa-assem.S #hppa-linux-stubs.S ARCH_SRC = hppa-arch.c undefineds.c -OS_SRC = linux-os.c hppa-linux-os.c os-common.c -LINKFLAGS+=-static -OS_LIBS= -ldl +OS_SRC = linux-os.c hppa-linux-os.c +OS_LIBS = -ldl -GC_SRC= cheneygc.c +GC_SRC = cheneygc.c Index: Config.mips-linux =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/Config.mips-linux,v retrieving revision 1.4 diff -u -p -r1.4 Config.mips-linux --- Config.mips-linux 30 Apr 2005 09:40:41 -0000 1.4 +++ Config.mips-linux 13 May 2005 19:03:54 -0000 @@ -1,3 +1,5 @@ +# -*- makefile -*- for the C-level run-time support for SBCL + # This software is part of the SBCL system. See the README file for # more information. # @@ -7,15 +9,14 @@ # provided with absolutely no warranty. See the COPYING and CREDITS # files for more information. -CFLAGS += -Dmips -g -LD = ld -LINKFLAGS = -v -g -O2 +CFLAGS += -Dmips +LINKFLAGS += -v -O2 NM = ./linux-nm ASSEM_SRC = mips-assem.S ldso-stubs.S ARCH_SRC = mips-arch.c -OS_SRC = linux-os.c mips-linux-os.c os-common.c -OS_LIBS= -ldl +OS_SRC = linux-os.c mips-linux-os.c +OS_LIBS = -ldl -GC_SRC= cheneygc.c +GC_SRC = cheneygc.c Index: Config.ppc-darwin =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/Config.ppc-darwin,v retrieving revision 1.9 diff -u -p -r1.9 Config.ppc-darwin --- Config.ppc-darwin 17 Apr 2005 19:41:28 -0000 1.9 +++ Config.ppc-darwin 13 May 2005 19:03:55 -0000 @@ -1,7 +1,17 @@ -# -*- makefile -*- -CFLAGS = -Dppc -g -Wall -O2 -no-cpp-precomp -fdollars-in-identifiers -OS_SRC = bsd-os.c os-common.c ppc-darwin-os.c ppc-darwin-dlshim.c ppc-darwin-langinfo.c -OS_LIBS = -lSystem -lc -lm +# -*- makefile -*- for the C-level run-time support for SBCL + +# This software is part of the SBCL system. See the README file for +# more information. +# +# This software is derived from the CMU CL system, which was +# written at Carnegie Mellon University and released into the +# public domain. The software is in the public domain and is +# provided with absolutely no warranty. See the COPYING and CREDITS +# files for more information. + +CFLAGS = -Dppc -g -Wall -O2 -fdollars-in-identifiers +OS_SRC = bsd-os.c ppc-darwin-os.c ppc-darwin-dlshim.c ppc-darwin-langinfo.c +OS_LIBS = -lSystem -lc OS_OBJS = ppc-darwin-rospace.o CC = gcc @@ -9,18 +19,18 @@ CC = gcc ASSEM_SRC = ppc-assem.S ldso-stubs.S ARCH_SRC = ppc-arch.c -CPP = cpp -no-cpp-precomp +CPPFLAGS += -no-cpp-precomp # KLUDGE: in OS X 10.3, Apple started putting the heap right where we # expect our read-only space mapped. This hack causes the linker to # place a zero-fill-on-demand segment in the same place and size as # read-only-space, which is the only thing capable of keeping malloc # out of this range. -OS_LINK_FLAGS = -dynamic `cat ppc-darwin-link-flags` -twolevel_namespace -bind_at_load +LINKFLAGS += -dynamic `cat ppc-darwin-link-flags` -twolevel_namespace -bind_at_load -GC_SRC= cheneygc.c +GC_SRC = cheneygc.c -CLEAN_FILES += ppc-darwin-mkrospace ppc-darwin-fix-rospace ppc-darwin-link-flags +OS_CLEAN_FILES += ppc-darwin-mkrospace ppc-darwin-fix-rospace ppc-darwin-link-flags ppc-darwin-mkrospace: ppc-darwin-mkrospace.c $(CC) -g -Wall -pedantic -o $@ $< Index: Config.ppc-linux =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/Config.ppc-linux,v retrieving revision 1.4 diff -u -p -r1.4 Config.ppc-linux --- Config.ppc-linux 2 Sep 2003 11:25:40 -0000 1.4 +++ Config.ppc-linux 13 May 2005 19:03:55 -0000 @@ -1,3 +1,5 @@ +# -*- makefile -*- for the C-level run-time support for SBCL + # This software is part of the SBCL system. See the README file for # more information. # @@ -8,15 +10,13 @@ # files for more information. CFLAGS = -g -Dppc -LD = ld -LINKFLAGS = -v -g -NM = nm -p +LINKFLAGS += -v -rdynamic +NM = ./linux-nm ASSEM_SRC = ppc-assem.S ldso-stubs.S ARCH_SRC = ppc-arch.c -OS_SRC = linux-os.c ppc-linux-os.c os-common.c -LINKFLAGS+=-rdynamic -OS_LIBS= -ldl +OS_SRC = linux-os.c ppc-linux-os.c +OS_LIBS = -ldl -GC_SRC= cheneygc.c +GC_SRC = cheneygc.c Index: Config.sparc-linux =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/Config.sparc-linux,v retrieving revision 1.4 diff -u -p -r1.4 Config.sparc-linux --- Config.sparc-linux 6 Aug 2002 11:46:32 -0000 1.4 +++ Config.sparc-linux 13 May 2005 19:03:55 -0000 @@ -1,3 +1,5 @@ +# -*- makefile -*- for the C-level run-time support for SBCL + # This software is part of the SBCL system. See the README file for # more information. # @@ -7,19 +9,15 @@ # provided with absolutely no warranty. See the COPYING and CREDITS # files for more information. -CFLAGS = -g -O3 -Wall -Dsparc +CFLAGS += -Dsparc ASFLAGS = -g -Wall -Dsparc -LD = ld -LINKFLAGS = -v -g -NM = nm -p +LINKFLAGS += -v -rdynamic +NM = ./linux-nm -ASSEM_SRC = sparc-assem.S -#ARCH_SRC = sparc-arch.c undefineds.c -ARCH_SRC = sparc-arch.c ldso-stubs.S +ASSEM_SRC = sparc-assem.S ldso-stubs.S +ARCH_SRC = sparc-arch.c #undefineds.c -OS_SRC = linux-os.c sparc-linux-os.c os-common.c -#LINKFLAGS+=-static -LINKFLAGS+=-rdynamic -OS_LIBS= -ldl +OS_SRC = linux-os.c sparc-linux-os.c +OS_LIBS = -ldl -GC_SRC= cheneygc.c +GC_SRC = cheneygc.c Index: Config.sparc-sunos =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/Config.sparc-sunos,v retrieving revision 1.4 diff -u -p -r1.4 Config.sparc-sunos --- Config.sparc-sunos 5 Apr 2003 13:04:15 -0000 1.4 +++ Config.sparc-sunos 13 May 2005 19:03:55 -0000 @@ -1,3 +1,5 @@ +# -*- makefile -*- for the C-level run-time support for SBCL + # This software is part of the SBCL system. See the README file for # more information. # @@ -7,21 +9,16 @@ # provided with absolutely no warranty. See the COPYING and CREDITS # files for more information. - -CC=gcc -CFLAGS = -g -O3 -Wall -Dsparc -DSVR4 +CC = gcc +CFLAGS += -Dsparc -DSVR4 ASFLAGS = -g -Wall -Dsparc -DSVR4 -LD = ld -LINKFLAGS = -v -g +LINKFLAGS += -v NM = nm -t x -p -ASSEM_SRC = sparc-assem.S -#ARCH_SRC = sparc-arch.c undefineds.c -ARCH_SRC = sparc-arch.c ldso-stubs.S +ASSEM_SRC = sparc-assem.S ldso-stubs.S +ARCH_SRC = sparc-arch.c #undefineds.c -OS_SRC = sunos-os.c sparc-sunos-os.c os-common.c -#LINKFLAGS+=-static -LINKFLAGS+= -OS_LIBS= -ldl -lsocket -lnsl -lrt +OS_SRC = sunos-os.c sparc-sunos-os.c +OS_LIBS = -ldl -lsocket -lnsl -lrt -GC_SRC= cheneygc.c +GC_SRC = cheneygc.c Index: Config.x86-bsd =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/Config.x86-bsd,v retrieving revision 1.9 diff -u -p -r1.9 Config.x86-bsd --- Config.x86-bsd 29 Jul 2003 13:01:56 -0000 1.9 +++ Config.x86-bsd 13 May 2005 19:03:55 -0000 @@ -1,3 +1,4 @@ +# -*- makefile -*- for the C-level run-time support for SBCL # configuration stuff shared between various *BSD OSes # This software is part of the SBCL system. See the README file for @@ -12,7 +13,7 @@ ASSEM_SRC = x86-assem.S ARCH_SRC = x86-arch.c -OS_SRC = bsd-os.c os-common.c undefineds.c x86-bsd-os.c -OS_LIBS = -lm # -ldl +OS_SRC = bsd-os.c undefineds.c x86-bsd-os.c +OS_LIBS = # -ldl GC_SRC = gencgc.c Index: Config.x86-freebsd =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/Config.x86-freebsd,v retrieving revision 1.3 diff -u -p -r1.3 Config.x86-freebsd --- Config.x86-freebsd 4 Dec 2000 15:30:51 -0000 1.3 +++ Config.x86-freebsd 13 May 2005 19:03:55 -0000 @@ -1,10 +1,20 @@ -# -*- makefile -*- +# -*- makefile -*- for the C-level run-time support for SBCL + +# This software is part of the SBCL system. See the README file for +# more information. +# +# This software is derived from the CMU CL system, which was +# written at Carnegie Mellon University and released into the +# public domain. The software is in the public domain and is +# provided with absolutely no warranty. See the COPYING and CREDITS +# files for more information. + include Config.x86-bsd ASSEM_SRC += ldso-stubs.S -# Until sbcl-0.6.7.3, we used "OS_LINK_FLAGS=-static" here, which +# Until sbcl-0.6.7.3, we used "LINKFLAGS+=-static" here, which # worked fine for most things, but LOAD-FOREIGN & friends require # dlopen() etc., which in turn depend on dynamic linking of the # runtime. -OS_LINK_FLAGS = -dynamic -export-dynamic +LINKFLAGS += -dynamic -export-dynamic Index: Config.x86-linux =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/Config.x86-linux,v retrieving revision 1.9 diff -u -p -r1.9 Config.x86-linux --- Config.x86-linux 6 Aug 2002 11:46:32 -0000 1.9 +++ Config.x86-linux 13 May 2005 19:03:55 -0000 @@ -1,3 +1,5 @@ +# -*- makefile -*- for the C-level run-time support for SBCL + # This software is part of the SBCL system. See the README file for # more information. # @@ -7,10 +9,12 @@ # provided with absolutely no warranty. See the COPYING and CREDITS # files for more information. +NM = ./linux-nm + ASSEM_SRC = x86-assem.S ldso-stubs.S ARCH_SRC = x86-arch.c +OS_SRC = linux-os.c x86-linux-os.c -OS_SRC = linux-os.c x86-linux-os.c os-common.c # The "--Wl,--export-dynamic" flags are here to help people # experimenting with callbacks from C to SBCL, by allowing linkage to # SBCL src/runtime/*.c symbols from C. Work on this is good, but it's @@ -23,7 +27,7 @@ OS_SRC = linux-os.c x86-linux-os.c os-co # (You *are* encouraged to design and implement a coherent stable # interface, though.:-| As far as I (WHN 2002-05-19) know, no one is # working on one and it would be a nice thing to have.) -OS_LINK_FLAGS = -Wl,--export-dynamic +LINKFLAGS += -Wl,--export-dynamic OS_LIBS = -ldl GC_SRC = gencgc.c Index: Config.x86-netbsd =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/Config.x86-netbsd,v retrieving revision 1.2 diff -u -p -r1.2 Config.x86-netbsd --- Config.x86-netbsd 9 Apr 2004 14:39:49 -0000 1.2 +++ Config.x86-netbsd 13 May 2005 19:03:55 -0000 @@ -1,7 +1,17 @@ -# -*- makefile -*- +# -*- makefile -*- for the C-level run-time support for SBCL + +# This software is part of the SBCL system. See the README file for +# more information. +# +# This software is derived from the CMU CL system, which was +# written at Carnegie Mellon University and released into the +# public domain. The software is in the public domain and is +# provided with absolutely no warranty. See the COPYING and CREDITS +# files for more information. + include Config.x86-bsd ASSEM_SRC += ldso-stubs.S -OS_LINK_FLAGS = -dynamic -export-dynamic +LINKFLAGS += -dynamic -export-dynamic CFLAGS = -g -Wall -O2 Index: Config.x86-openbsd =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/Config.x86-openbsd,v retrieving revision 1.1 diff -u -p -r1.1 Config.x86-openbsd --- Config.x86-openbsd 2 Oct 2000 17:27:11 -0000 1.1 +++ Config.x86-openbsd 13 May 2005 19:03:55 -0000 @@ -1,3 +1,14 @@ +# -*- makefile -*- for the C-level run-time support for SBCL + +# This software is part of the SBCL system. See the README file for +# more information. +# +# This software is derived from the CMU CL system, which was +# written at Carnegie Mellon University and released into the +# public domain. The software is in the public domain and is +# provided with absolutely no warranty. See the COPYING and CREDITS +# files for more information. + include Config.x86-bsd # KLUDGE: It might seem as though dynamic libraries should work the @@ -7,4 +18,4 @@ include Config.x86-bsd # have never found documentation for the "-export-dynamic" option), # so I've just punted and left link flags for OpenBSD in their # pre-dynamic-library-support state. -- WHN 2000-10-02 -OS_LINK_FLAGS = -static +LINKFLAGS += -static Index: Config.x86_64-linux =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/Config.x86_64-linux,v retrieving revision 1.2 diff -u -p -r1.2 Config.x86_64-linux --- Config.x86_64-linux 6 Jan 2005 12:48:03 -0000 1.2 +++ Config.x86_64-linux 13 May 2005 19:03:55 -0000 @@ -1,3 +1,5 @@ +# -*- makefile -*- for the C-level run-time support for SBCL + # This software is part of the SBCL system. See the README file for # more information. # @@ -7,10 +9,12 @@ # provided with absolutely no warranty. See the COPYING and CREDITS # files for more information. +NM = ./linux-nm + ASSEM_SRC = x86-64-assem.S ldso-stubs.S ARCH_SRC = x86-64-arch.c +OS_SRC = linux-os.c x86-64-linux-os.c -OS_SRC = linux-os.c x86-64-linux-os.c os-common.c # The "--Wl,--export-dynamic" flags are here to help people # experimenting with callbacks from C to SBCL, by allowing linkage to # SBCL src/runtime/*.c symbols from C. Work on this is good, but it's @@ -23,9 +27,9 @@ OS_SRC = linux-os.c x86-64-linux-os.c os # (You *are* encouraged to design and implement a coherent stable # interface, though.:-| As far as I (WHN 2002-05-19) know, no one is # working on one and it would be a nice thing to have.) -OS_LINK_FLAGS = -Wl,--export-dynamic +LINKFLAGS += -Wl,--export-dynamic OS_LIBS = -ldl -CFLAGS = -g -Wall -O3 -fno-omit-frame-pointer -GC_SRC = gencgc.c +CFLAGS += -fno-omit-frame-pointer +GC_SRC = gencgc.c Index: GNUmakefile =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/GNUmakefile,v retrieving revision 1.20 diff -u -p -r1.20 GNUmakefile --- GNUmakefile 10 Apr 2005 15:34:59 -0000 1.20 +++ GNUmakefile 13 May 2005 19:03:55 -0000 @@ -1,4 +1,4 @@ -# makefile for the C-level run-time support for SBCL +# -*- makefile -*- for the C-level run-time support for SBCL # This software is part of the SBCL system. See the README file for # more information. @@ -9,64 +9,80 @@ # provided with absolutely no warranty. See the COPYING and CREDITS # files for more information. -all: sbcl sbcl.nm -.PHONY: all +.PHONY: all clean TAGS tags -# defaults which might be overridden or modified by values in the -# Config file -CFLAGS = -g -Wall -O3 -ASFLAGS = $(CFLAGS) -CPPFLAGS = -I. +all: sbcl sbcl.nm -# Some of these things might be Config-dependent in future versions, -# but they're the same on most systems right now. If you need to -# override one of these, do it in Config -CPP = cpp +# Defaults which might be overridden or modified by values in the +# Config file. Most of them are same on most systems right now. +# If you need to override one of these, do it in Config. LD = ld LINKFLAGS = -g NM = nm -gp -DEPEND_FLAGS=-M +DEPEND_FLAGS = -MM + +CFLAGS = -g -Wall -O3 +ASFLAGS = $(CFLAGS) +CPPFLAGS = -I. # The Config file is the preferred place for tweaking options which -# are appropriate for particular setups (OS, CPU, whatever). Make a +# are appropriate for particular setups (OS, ARCH, whatever). Make a # Config-foo file for setup foo, then arrange for Config to be a # symlink to Config-foo. +# Commonly used variables in Config are: ARCH_SRC, ASSEM_SRC, GC_SRC, +# OS_SRC, OS_LIBS, OS_OBJS, OS_CLEAN_FILES include Config -C_SRCS = alloc.c backtrace.c breakpoint.c coreparse.c \ +COMMON_SRC = alloc.c backtrace.c breakpoint.c coreparse.c \ dynbind.c gc-common.c globals.c interr.c interrupt.c \ - monitor.c parse.c print.c purify.c \ + monitor.c os-common.c parse.c print.c purify.c \ regnames.c run-program.c runtime.c save.c search.c \ thread.c time.c util.c validate.c vars.c wrap.c -SRCS = $(C_SRCS) ${ARCH_SRC} ${ASSEM_SRC} ${OS_SRC} ${GC_SRC} +C_SRC = $(COMMON_SRC) ${ARCH_SRC} ${OS_SRC} ${GC_SRC} -OBJS = $(patsubst %.c,%.o,$(patsubst %.S,%.o,$(patsubst %.s,%.o,$(SRCS)))) ${OS_OBJS} +SRCS = $(C_SRC) ${ASSEM_SRC} -sbcl.nm: sbcl - $(NM) sbcl | grep -v " F \| U " > ,$@ - mv -f ,$@ $@ +OBJS = $(C_SRC:.c=.o) $(ASSEM_SRC:.S=.o) ${OS_OBJS} -sbcl: ${OBJS} - $(CC) ${LINKFLAGS} ${OS_LINK_FLAGS} -o $@ ${OBJS} ${OS_OBJS} ${OS_LIBS} -lm +LIBS = ${OS_LIBS} -lm +sbcl: $(OBJS) $(LIBS) + $(CC) ${LINKFLAGS} -o $@ $^ -.PHONY: clean all -clean: - -rm -f depend *.o sbcl sbcl.nm core *.tmp $(CLEAN_FILES) - -TAGS: $(SRCS) - etags $(SRCS) +sbcl.nm: sbcl + $(NM) sbcl | grep -v " F \| U " > ,$@ + mv -f ,$@ $@ -sbcl.h: genesis/*.h +sbcl.h: $(wildcard genesis/*.h) echo '#include "genesis/config.h"' >sbcl.h echo '#include "genesis/constants.h"' >>sbcl.h -depend: ${C_SRCS} sbcl.h - $(CC) ${DEPEND_FLAGS} ${CFLAGS} ${CPPFLAGS} ${C_SRCS} > depend.tmp - mv -f depend.tmp depend - -# By including this file, we cause GNU make to automatically "make depend" -# if it can't find it or it is out of date. -include depend +TAGS tags: $(SRCS) + etags $(SRCS) + +clean: + -rm -f *.[do] sbcl sbcl.nm sbcl.h core *.tmp $(OS_CLEAN_FILES) + # the depend file is obsolete + -rm -f depend + +# depend target for backward compatibility +.PHONY: depend +depend: + +%.d: %.c sbcl.h + @$(CC) $(DEPEND_FLAGS) $(CPPFLAGS) $< > $@.tmp; \ + sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.tmp > $@; \ + rm -f $@.tmp + +%.d: %.S sbcl.h + @$(CC) $(DEPEND_FLAGS) $(CPPFLAGS) $< > $@.tmp; \ + sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.tmp > $@; \ + rm -f $@.tmp + +# By including those files, we cause GNU make to automatically re-make +# all dependencies of the .c file if necessary. +ifneq ($(MAKECMDGOALS),clean) +-include $(C_SRC:.c=.d) $(ASSEM_SRC:.S=.d) +endif |