Hi! It took me three days to make the changes necessary to separate the build from the source tree. It's not clean. I would like to see add an install option so I can install the code in the system default directory after I've tested it in my workspace. At the moment, I was able to run build to create the working installation and run the "Halfadder" tutorial. Obviously, this is not an exhaustive test, but I'm confident the process works. Strategy ======== I modified all Makefiles so could reference the source tree. The "build" script created symlinks from the "build" tree to the "source" tree Makefiles and make ran recursively, as it always has. I ran into problems with the GNU gcc 1.42 compiler. I made a smarter Makefile to link more source files in the build space. The "ocp" and "ocr" directories presented a bigger challenge, as I didn't have the libtools, autoconf or automake. Here, I had to add a "-I /usr/share/aclocal" option to the aclocal command in autogen.sh. Comments ======== My motivation was to enable separate builds from the same source tree so one could test a new configuration before releasing it. Arguably, this might just add complexity, but I liked the approach because you can quickly determine your source integrity. Things did get a little messy with the autoconf creating "Makefile.in" files in the source tree and my changing a lot of the Makefile rules, especially leaning towards implicit pattern rules which, again managed to create ".o" files in the source where the ".c" files sat. Action ====== I need to make all patches available - what is the best way to do this? (The 288 lines below are just the tip of the iceberg) I'd like to hear back from the development community and I can revise my changes to assimulate the latest CVS tree content. I would also like to clean up some of the changes I've made with ideas from software developers who have more elegant or effective solutions. Performance in compiling, testing and normal usage are very important and I believe there are caching opportunities as well as more efficient ways to so some of what needs to be done. (Admittedly, I'm Unix biased - and Cygwin 1.3.5+ enables real Unix emulation, e.g., all scripts see the standard Unix mount points, libraries and tools, e.g., /tmp, /usr/, /lib, gcc...) I've appended the first 288 lines of the raw 19916 lines of context diff - Unix format newlines. I'd rather zip or tar-compress this file after I've edited out the "accidentally" modified files. Please advise. I want to share this data, but it's a lot (I think too much) for an email and I know the mailing list does not like MIME encoding. BTW, this is a change which needs to be committed to CVS: Index: sources/ocp/src/placer/PDetPlacement.cpp =================================================================== RCS file: /cvs/alliance/sources/ocp/src/placer/PDetPlacement.cpp,v retrieving revision 1.1 diff -b -i -c -r1.1 PDetPlacement.cpp *** sources/ocp/src/placer/PDetPlacement.cpp 3 Jan 2002 19:18:06 -0000 1.1 --- sources/ocp/src/placer/PDetPlacement.cpp 11 Jan 2002 05:06:00 -0000 *************** *** 1,5 **** #include "PDetPlacement.h" ! #include <values.h> #include "PBin.h" #include "PPlacement.h" --- 1,5 ---- #include "PDetPlacement.h" ! /* #include <values.h> - obsolete */ #include "PBin.h" #include "PPlacement.h" --- end of diff --- I would like to sync my local cache with your site, but I'm not familiar enough with CVS to do this right. As it stands, I inadvertently wind up changing the revs! I typically do a "cvs update" from your site, then I am forced to do a "cvs import" into my repository, but then merge fouls things up when I edit some files... Some in a newsgroup suggested doing a CVS checkout of the control files, I guess that would be "cvs co CVSROOT" or something, then replacing these files in the local repository and somehow doing a "cvs ci" to pull all data from the working directories into the local repository. I don't know about this. cvs is VERY slow and even slower under Cygwin. I just haven't gotten around to creating the repository under Linux and using the cvs client/server mode to do light duty operations under Cygwin and reserve the heavy duty stuff for Linux. Sorry for the discussion - should discussions be done the alliance-support mailing list? Thanks, Art > -----Original Message----- > From: Art [mailto:pinaar@austin.rr.com] > Sent: Tuesday, January 08, 2002 10:14 AM > To: alliance-programmers@asim.lip6.fr > Subject: Re: separating build from source dirs > > > > -----Original Message----- > > From: Czo [Olivier Sirol] [mailto:Olivier.Sirol@lip6.fr] > > Sent: Tuesday, January 08, 2002 9:19 AM > ... > > Art wrote: > > > > > I've sync'd up my local CVS repository with yours and > > > have separated the "source" from the "build" directories. > > > > > > I am thinking about posting the "diff -c" of the "build", "Makefile", > > > "configure", "configure.in" and the "mbk/Makefile", once I rebuild > > > ... > > > > > > Hi! > > > > I think you can send these patches even if we are planning > > to put all alliance tools under autoconf / automake ....but beware: > > I will commit some Makefiles in a short time (bison pb...) > > That's Ok. I am still testing my "build" procedure. > I moved configure and *.in from the share dir to the sources > dir so I can issue the command: > > configure --srcdir=$SRCDIR > > from the "build" script and not have "configure" complain. > > > For the moment I use lndir to keep the source tree clean. You can > > have a look at multibuild in the sourecs/distrib dir. > > I will take a quick look at "multibuild" before posting my changes, > just in case there is something stupid I am thinking about doing. > I might still do it, but I'll know. :-> > > Thanks & Regards, > > Art -- appended first 288 lines of patch via cvs -d /cvs diff -bi -R -c sources -- Index: sources/Makefile =================================================================== RCS file: /cvs/alliance/sources/Makefile,v retrieving revision 1.1.1.1 diff -b -i -c -r1.1.1.1 Makefile *** sources/Makefile 3 Jan 2002 19:17:37 -0000 1.1.1.1 --- sources/Makefile 6 Jan 2002 09:06:26 -0000 *************** *** 37,43 **** # a ajouter : # c4 - ALL_DIRS = mbk mbkal mbkedif mbkhilo mbkspice mbkvhdl mbkvti mbkvrlog mbkap mb kmg bdd beh behvhdl gscr pat rds rdscif rdsgds elp icones cns genlib rsa bsg rfg amg asimut alcban asm fitpath dpr druc syf dreal graal rage genview flop grog r ds2ps scr lvx ring s2r lynx genpat sl testools flatbeh mbktools algue fpmap boog loon scapin power dpgen sea pcbs obsolete ocp ocr --- 37,42 ---- *************** *** 45,51 **** all : @for DIR in $(ALL_DIRS) ;\ ! do echo %%%%%%%%% building $$DIR ; $(MAKE) -C $$DIR ;\ if [ $$? -ne 0 ] ;\ then exit 1 ;\ fi ;\ --- 44,57 ---- all : @for DIR in $(ALL_DIRS) ;\ ! do echo %%%%%%%%% building $$DIR ; \ ! if [ ! -L $$DIR/Makefile ] ;\ ! then \ ! mkdir $$DIR ;\ ! echo ln -s $(SRCDIR)/$$DIR/Makefile $$DIR;\ ! ln -s $(SRCDIR)/$$DIR/Makefile $$DIR;\ ! fi ;\ ! $(MAKE) -C $$DIR ;\ if [ $$? -ne 0 ] ;\ then exit 1 ;\ fi ;\ Index: sources/build =================================================================== RCS file: /cvs/alliance/sources/build,v retrieving revision 1.14 diff -b -i -c -r1.14 build *** sources/build 20 Mar 2001 11:33:13 -0000 1.14 --- sources/build 11 Jan 2002 06:53:08 -0000 *************** *** 7,36 **** # # (C) Czo 1998,99 # This code is released under GPL ! <<<<<<< build ! # $Id: build,v 1.14 2001/03/20 11:33:13 czo Exp $ ! ======= ! # $Id: build,v 1.14 2001/03/20 11:33:13 czo Exp $ ! >>>>>>> 1.1.1.1 # ! MYDIR=`pwd` ! cd ../share/etc echo "Configuring..." ! # ./configure ! # if [ $? -ne 0 ] ; then echo "Error, exiting" ; exit 4 ; fi echo "Sourcing env..." . ./alc_env.sh if [ $? -ne 0 ] ; then echo "Error, exiting" ; exit 4 ; fi ! cd "$MYDIR" ! ! echo "Making links..." ! ./mklinks "$ALLIANCE_OS" ! if [ $? -ne 0 ] ; then echo "Error, exiting" ; exit 4 ; fi echo "Compiling..." # WARNING : modifying CFLAGS on make command line --- 7,70 ---- # # (C) Czo 1998,99 # This code is released under GPL ! # $Id: build,v 1.14 2002/01/05 18:16:27 pinaar Exp $ # + # Remarks : env var: EXEC -- Very local temporary variable + # : env SRCDIR -- defined here and passed to configure ! BUILDIR=`pwd` ! SRCDIR=`dirname $0` ! # Get parent absolute path ! (cd $SRCDIR;SRCDIR=`pwd`) ! export SRCDIR ! PDIR=`dirname $SRCDIR` ! ! echo "Building in '$BUILDIR'" ! ! # Current build does not use configure.in ! CONF=configure echo "Configuring..." ! CONFSTS=config.status ! if [ -f $CONFSTS ]; then ! echo "Skipping configure - delete $CONFSTS to re-configure" ! else ! if [ -f $CONF ]; then ! EXEC=./$CONF ! else ! EXEC=$SRCDIR/$CONF ! fi ! $EXEC --srcdir=$SRCDIR ! fi echo "Sourcing env..." . ./alc_env.sh if [ $? -ne 0 ] ; then echo "Error, exiting" ; exit 4 ; fi ! cd $BUILDIR # Create links vs copying to installation dir - if needed ! if [ -d archi/$ALLIANCE_OS/bin ]; then ! echo "Dir found - skipping dir and links creation in" ! echo " $BUILDIR/archi/$ALLIANCE_OS" ! else ! echo "Creating dirs... in $BUILDIR/archi/$ALLIANCE_OS" ! mkdir -p "archi/$ALLIANCE_OS/bin" ! mkdir -p "archi/$ALLIANCE_OS/etc" ! mkdir -p "archi/$ALLIANCE_OS/include" ! mkdir -p "archi/$ALLIANCE_OS/lib" ! if [ $? -ne 0 ] ; then echo "Error, exiting" ; exit 4 ; fi ! if [ ! -L archi/$ALLIANCE_OS/doc ]; then ! echo "Making links... in $BUILDIR/archi/$ALLIANCE_OS" ! ln -s $PDIR/share/cells "archi/$ALLIANCE_OS" ! ln -s $PDIR/share/doc "archi/$ALLIANCE_OS" ! ln -s $PDIR/share/man "archi/$ALLIANCE_OS" ! ln -s $PDIR/share/tutorials "archi/$ALLIANCE_OS" ! # etc files - differs from installation ! ln -s $PDIR/share/etc/libraries.mk archi/$ALLIANCE_OS/etc ! ln -s $BUILDIR/$ALLIANCE_OS.mk archi/$ALLIANCE_OS/etc ! fi ! if [ $? -ne 0 ] ; then echo "Error, exiting" ; exit 4 ; fi ! fi echo "Compiling..." # WARNING : modifying CFLAGS on make command line *************** *** 38,64 **** # of Linux.mk included value of CFLAGS # MAKEOP="ALLIANCE_INSTALL_DIR=$ALLIANCE_TOP STRIP=echo $*" echo make $MAKEOP make $MAKEOP # on strip ici tous les exe cd "$ALLIANCE_TOP/bin" strip * ! cd "$MYDIR" if [ $? -ne 0 ] then echo "In csh, you can run :" echo "source $ALLIANCE_TOP/etc/alc_env.csh" ! echo "cd $MYDIR" echo "make $MAKEOP" echo "" echo "Errors have occured" exit 4 else echo "In csh, you can run :" echo "source $ALLIANCE_TOP/etc/alc_env.csh" ! echo "cd $MYDIR" echo "make $MAKEOP" echo "" echo "Remember to link $ALLIANCE_TOP/etc/alc_env.{c}sh to /etc/profile .d" --- 72,116 ---- # of Linux.mk included value of CFLAGS # + MFILE=$BUILDIR/Makefile + cd $BUILDIR + if [ ! -L $MFILE ]; then + ln -s $SRCDIR/Makefile + fi MAKEOP="ALLIANCE_INSTALL_DIR=$ALLIANCE_TOP STRIP=echo $*" echo make $MAKEOP make $MAKEOP # on strip ici tous les exe + echo "cd ALLIANCE_TOP/bin # and strip code" cd "$ALLIANCE_TOP/bin" + pwd strip * ! ! cd "$BUILDIR" if [ $? -ne 0 ] then echo "In csh, you can run :" echo "source $ALLIANCE_TOP/etc/alc_env.csh" ! echo "cd $BUILDIR" echo "make $MAKEOP" echo "" echo "Errors have occured" exit 4 else + echo "Now, linking design files in etc build/work tree" + FILES=`(cd $PDIR/share/etc;ls cmos*)` + for f in $FILES; do + s=$PDIR/share/etc/$f + t=archi/$ALLIANCE_OS/etc/$f + if [ ! -L $t ]; then + ln -s $s $t + fi + done + echo "In csh, you can run :" echo "source $ALLIANCE_TOP/etc/alc_env.csh" ! echo "cd $BUILDIR" echo "make $MAKEOP" echo "" echo "Remember to link $ALLIANCE_TOP/etc/alc_env.{c}sh to /etc/profile .d" Index: sources/alcban/Makefile =================================================================== RCS file: /cvs/alliance/sources/alcban/Makefile,v retrieving revision 1.1 diff -b -i -c -r1.1 Makefile *** sources/alcban/Makefile 3 Jan 2002 19:17:38 -0000 1.1 --- sources/alcban/Makefile 7 Jan 2002 03:23:26 -0000 *************** *** 26,37 **** # Date : 1996,97 # Author : Czo <Olivier.Sirol@lip6.fr> # ! # $Id: Makefile,v 1.1 2002/01/03 19:17:38 pinaar Exp $ # include $(ALLIANCE_TOP)/etc/$(ALLIANCE_OS).mk include $(ALLIANCE_TOP)/etc/libraries.mk #TARGET_BIN =. --- 26,38 ---- # Date : 1996,97 # Author : Czo <Olivier.Sirol@lip6.fr> # ! # $Id: Makefile,v 1.3 1999/11/05 16:43:22 czo Exp $ # include $(ALLIANCE_TOP)/etc/$(ALLIANCE_OS).mk include $(ALLIANCE_TOP)/etc/libraries.mk + sdir=$(SRCDIR)/alcban #TARGET_BIN =. *************** *** 59,73 **** LOCAL_OBJ = alcbanner.o ! .c.o: ! $(CC) -c -o $@ $(LOCAL_CFLAGS) $(LOCAL_INC) $< all : $(EXEC) $(EXEC) : $(LOCAL_OBJ) ! $(CC) -o $(EXEC) $(LOCAL_CFLAGS) $(LOCAL_OBJ) $(LOCAL_LIB) -lm clean : --- 60,74 ---- LOCAL_OBJ = alcbanner.o ! %.o: $(sdir)/%.c ! $(CC) -c $(LOCAL_CFLAGS) $(LOCAL_INC) $< all : $(EXEC) $(EXEC) : $(LOCAL_OBJ) ! $(CC) -o $(EXEC) $(LOCAL_CFLAGS) $< $(LOCAL_LIB) -lm clean :