octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: streamlining build process.


From: Ben Sapp
Subject: Re: streamlining build process.
Date: Mon, 20 Mar 2000 14:17:04 -0700

The patches I have attached make it so that ar is called only once for
each library.   I believe that all dependency information is handled
correctly, even in lubcruft.   The src and liboctave directories were
trivial.  libcruft was a bit more of a problem.    I tested it on IRIX
and also Linux.   I also tested it with shared and static libraries. 

The patches are applicable to the unstable CVS from a few days ago.  Let
me know if there are any problems with them. 

Attachment name            file it patches
---------------------------------------------------------
configure.in            -> octave/configure.in
libcruft_Makefile.in    -> octave/libcruft/Makefile.in
libcruft_Makerules.in   -> octave/libcruft/Makerules.in
liboctave_Makefile.in   -> octave/liboctave/Makefile.in
Makeconf.in             -> octave/Makeconf.in
src_Makefile.in         -> octave/src/Makefile.in

Thanks.  

-- 
Ben Sapp                         Los Alamos National Laboratory
email: <mailto:address@hidden>   Phone: (505)667-3277
Fax:   (505)665-7920             URL:   http://www.neutrino.lanl.gov/
--
Index: configure.in
===================================================================
RCS file: /cvs/octave/configure.in,v
retrieving revision 1.323
diff -u -r1.323 configure.in
--- configure.in        2000/02/12 02:24:41     1.323
+++ configure.in        2000/03/17 16:33:43
@@ -427,7 +427,7 @@
 %.c : %.f
 
 %.o : %.f
-       $(FC) -c $(ALL_FFLAGS) $<
+       $(FC) -c $(ALL_FFLAGS) -o $@ $<
 
 pic/%.o : %.f
        $(FC) -c $(FPICFLAG) $(ALL_FFLAGS) $< -o $@
Index: Makefile.in
===================================================================
RCS file: /cvs/octave/libcruft/Makefile.in,v
retrieving revision 1.63
diff -u -r1.63 Makefile.in
--- Makefile.in 1999/10/19 17:52:29     1.63
+++ Makefile.in 2000/03/17 17:47:07
@@ -36,7 +36,7 @@
   BINDISTFILES = libcruft.$(SHLEXT_VER)
 endif
 
-all: $(SUBDIRS) shared-lib
+all: libcruft.$(LIBEXT) shared-lib
 .PHONY: all
 
 $(SUBDIRS):
@@ -47,8 +47,8 @@
 # XXX FIXME XXX -- this should build the shared library directly from
 # a normal archive file (created from PIC code, though).
 
-MISC_OBJ := misc/machar.o misc/dostop.o misc/f77-extern.o \
-       misc/f77-fcn.o misc/lo-error.o
+SPECIAL_DEPEND := machar.o dostop.o f77-extern.o f77-fcn.o lo-error.o  
+MISC_OBJ := $(addprefix misc/,$(SPECIAL_DEPEND))
 
 CRUFT_FSRC := $(foreach dir, $(SUBDIRS), $(wildcard $(srcdir)/$(dir)/*.f))
 CRUFT_OBJ2 := $(patsubst $(srcdir)/%, %, $(CRUFT_FSRC))
@@ -67,12 +67,16 @@
 endif
 
 ifeq ($(SHARED_LIBS), true)
-shared-lib: libcruft.$(SHLEXT)
+shared-lib: $(SUBDIRS) libcruft.$(SHLEXT)
 else
 shared-lib:
 endif
 .PHONY: shared-lib
 
+libcruft.$(LIBEXT): $(CRUFT_OBJ)
+       $(AR) $(ARFLAGS) $@ $^
+       $(RANLIB) $@
+
 libcruft.$(SHLEXT): libcruft.$(SHLEXT_VER)
        rm -f $@
        $(LN_S) $< $@
@@ -149,3 +153,14 @@
          echo $(BINDISTLIBS) >> ../`cat ../.fname`/LIBRARIES; \
        fi
 .PHONY: bin-dist
+
+# Don't optimize.
+
+XCC = $(patsubst -O%, , $(CC))
+XALL_CFLAGS = $(patsubst -O%, , $(ALL_CFLAGS))
+
+misc/machar.o: $(srcdir)/misc/machar.c
+       $(XCC) -c $(CPPFLAGS) $(XALL_CFLAGS) -DDP $< -o $@
+
+misc/pic/machar.o: $(srcdir)/misc/machar.c
+       $(XCC) -c $(CPPFLAGS) $(CPICFLAG) $(XALL_CFLAGS) -DDP $< -o $@
Index: Makerules.in
===================================================================
RCS file: /cvs/octave/libcruft/Makerules.in,v
retrieving revision 1.27
diff -u -r1.27 Makerules.in
--- Makerules.in        1999/11/03 19:54:16     1.27
+++ Makerules.in        2000/03/17 17:47:25
@@ -35,7 +35,7 @@
 
 LIBCRUFT_OBJS = $(CRUFT_OBJ) $(SPECIAL_DEPEND)
 
-LIBCRUFT_DEPS = $(LIBCRUFT)($(LIBCRUFT_OBJS))
+LIBCRUFT_DEPS = $(LIBCRUFT_OBJS) $(LIBCRUFT)
 
 ifeq ($(STATIC_LIBS), true)
   LIBCRUFT_DEPEND := $(LIBCRUFT_DEPS)
Index: Makefile.in
===================================================================
RCS file: /cvs/octave/liboctave/Makefile.in,v
retrieving revision 1.132
diff -u -r1.132 Makefile.in
--- Makefile.in 2000/03/17 11:03:52     1.132
+++ Makefile.in 2000/03/20 17:00:17
@@ -148,18 +148,22 @@
 
 ifeq ($(SHARED_LIBS), true)
   ifeq ($(STATIC_LIBS), true)
-    libraries: liboctave.$(LIBEXT)($(OBJECTS)) liboctave.$(SHLEXT)
+    libraries: liboctave.$(LIBEXT) liboctave.$(SHLEXT)
   else
     libraries: liboctave.$(SHLEXT)
   endif
 else
   ifeq ($(STATIC_LIBS), true)
-    libraries: liboctave.$(LIBEXT)($(OBJECTS))
+    libraries: liboctave.$(LIBEXT)
   else
     libraries:
   endif
 endif
 .PHONY: libraries
+
+liboctave.$(LIBEXT): $(OBJECTS)
+       $(AR) $(ARFLAGS) $@ $^
+       $(RANLIB) $@
 
 liboctave.$(SHLEXT): liboctave.$(SHLEXT_VER)
        rm -f $@
Index: Makeconf.in
===================================================================
RCS file: /cvs/octave/Makeconf.in,v
retrieving revision 1.103
diff -u -r1.103 Makeconf.in
--- Makeconf.in 2000/02/12 02:24:41     1.103
+++ Makeconf.in 2000/03/17 17:21:11
@@ -279,10 +279,10 @@
 # How to make .o files:
 
 %.o : %.c
-       $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
+       $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< -o $@
 
 %.o : %.cc
-       $(CXX) -c $(CPPFLAGS) $(ALL_CXXFLAGS) $<
+       $(CXX) -c $(CPPFLAGS) $(ALL_CXXFLAGS) $< -o $@
 
 pic/%.o : %.c
        $(CC) -c $(CPPFLAGS) $(CPICFLAG) $(ALL_CFLAGS) $< -o $@
Index: Makefile.in
===================================================================
RCS file: /cvs/octave/src/Makefile.in,v
retrieving revision 1.247
diff -u -r1.247 Makefile.in
--- Makefile.in 2000/03/17 11:01:03     1.247
+++ Makefile.in 2000/03/20 16:59:59
@@ -243,13 +243,13 @@
 
 ifeq ($(SHARED_LIBS), true)
   ifeq ($(STATIC_LIBS), true)
-    libraries: liboctinterp.$(LIBEXT)($(OBJECTS)) liboctinterp.$(SHLEXT)
+    libraries: liboctinterp.$(LIBEXT) liboctinterp.$(SHLEXT)
   else
     libraries: liboctinterp.$(SHLEXT)
   endif
 else
   ifeq ($(STATIC_LIBS), true)
-    libraries: liboctinterp.$(LIBEXT)($(OBJECTS))
+    libraries: liboctinterp.$(LIBEXT)
   else
     libraries:
   endif

reply via email to

[Prev in Thread] Current Thread [Next in Thread]