Alex Vinokur wrote
Subject: mkmf and file system structure
Date: 1999/10/28
Forum: comp.unix.programmer
http://www.deja.com/=dnc/[ST_rn=ps]/getdoc.xp?AN=541526161
> Hi,
>
> I have got a problem with
> the mkmf command.
> (By the way, this is an excelent utility).
>
> I need the following structure of my directories
> with source and header files.
>
> ===================================================
> --------------------
> $(PROJECT)/COMMON
> $(PROJECT)/COMMON/src : contains COMMON sources
> $(PROJECT)/COMMON/inc : contains COMMON headers
>
> --------------------
> $(PROJECT)/AAA
> $(PROJECT)/AAA/src : contains AAA sources and makefile_AAA
> $(PROJECT)/AAA/inc : contains AAA headers
> makefile_AAA : List of source code files (SRCS) must contain
> 1) AAA sources and
> 2) COMMON sources
>
> --------------------
> $(PROJECT)/BBB
> $(PROJECT)/BBB/src : contains BBB sources and makefile_BBB
> $(PROJECT)/BBB/inc : contains BBB headers
> makefile_BBB : List of source code files (SRCS) must contain
> 1) BBB sources and
> 2) COMMON sources
>
> ===================================================
>
> There are two problems :
> 1) How can we make makefile_AAA (makefile_BBB)
> contain COMMON sources?
> 2) How can we make makefile_AAA (makefile_BBB)
> contain COMMON, AAA, BBB headers?
>
> ###########################
>
> Now I have to use the following structure:
> ===================================================
> ====================
> $(PROJECT)/COMMON
> source files : zzz1.C, zzz2.C, ...
> header files : zzz1.H, zzz2.H, ...
>
> ====================
> $(PROJECT)/COMMON/AAA
> source files : aaa1.C, aaa2.C, ...
> header files : aaa1.H, aaa2.H, ...
> makefile_AAA
> special source files : _zzz1.C, _zzz2.C, ...
>
> File _zzz1.C contains two lines :
> ---------------------------
> #include "../zzz1.C"
> #include "../zzz1.H"
> ---------------------------
>
> File _zzz2.C contains two lines :
> ---------------------------
> #include "../zzz2.C"
> #include "../zzz2.H"
> ---------------------------
>
> -------------------------------------------
> To obtain needed makefile I use the command
> mkmf -f makefile_AAA
> -------------------------------------------
>
> ====================
> $(PROJECT)/COMMON/BBB
> source files : bbb1.C, bbb2.C, ...
> header files : bbb1.H, bbb2.H, ...
> makefile_BBB
>
> File _zzz1.C contains two lines :
> ---------------------------
> #include "../zzz1.C"
> #include "../zzz1.H"
> ---------------------------
>
> File _zzz2.C contains two lines :
> ---------------------------
> #include "../zzz2.C"
> #include "../zzz2.H"
> ---------------------------
>
> -------------------------------------------
> To obtain needed makefile I use the command
> mkmf -f makefile_BBB
> -------------------------------------------
>
> ===================================================
>
> Thanks in advance,
> Alex
>
[snip]
Here is a method that enables to build
all dependences in all Makefiles
of project-file-system.
The method is based on using
the mkmf command and
the makedepend command.
Alex
-------------------------------------------------------
---> Let the project-file-system has the following structure.
-------------------------------------------------------
//=======================================
//========== Part#1.1. Directories ======
//=======================================
//--------------
setenv PROJ1_DIR /sun1/users/user1/proj
//--------------
$PROJ1_DIR contains directories :
- COMMON
- AAA
- BBB
...
$PROJ1_DIR/COMMON contains directories :
- inc
- src
- lib
$PROJ1_DIR/AAA contains directories :
- inc
- src
- bin
//-----------------
$PROJ1_DIR/BBB and other directories are similar $PROJ1_DIR/AAA
//-----------------
//=======================================
//========== Part#1.2. Files ============
//=======================================
$PROJ1_DIR/COMMON/inc contains:
- zzz1_2.H
- zzz1_3.H
- zzz2_2.H
- zzz2_3.H
$PROJ1_DIR/COMMON/src contains:
- zzz1_1.H
- zzz2_1.H
- zzz1.C
- zzz2.C
- Makefile
$PROJ1_DIR/AAA/inc contains:
- aaa1_2.H
- aaa1_3.H
- aaa2_2.H
- aaa2_3.H
$PROJ1_DIR/AAA/src contains:
- aaa1_1.H
- aaa2_1.H
- aaa1.C
- aaa2.C
- aaa_main.C
- Makefile
//=======================================
//=== Part#2.1. $PROJ1_DIR/COMMON/inc ===
//=======================================
Header files' content is shown below :
//---------------------
// File zzz1_2.H
#include <iostream>
#include <list>
// Stuff
//---------------------
//---------------------
// File zzz1_3.H
#include <vector>
// Stuff
//---------------------
//---------------------
// File zzz2_2.H
#include <stdio.h>
// Stuff
//---------------------
//---------------------
// File zzz2_3.H
#include <assert.h>
// Stuff
//---------------------
//=======================================
//=== Part#2.2. $PROJ1_DIR/COMMON/src ===
//=======================================
Header and source files' content is shown below :
//---------------------
// File zzz1_1.H
#include <map>
// Stuff
//---------------------
//---------------------
// File zzz2_1.H
#include <string.h>
// Stuff
//---------------------
//---------------------
// File zzz1.C
#include "zzz1_1.H"
#include "../inc/zzz1_2.H"
#include "zzz1_3.H"
// Stuff
//---------------------
//---------------------
// File zzz2.C
#include "zzz2_1.H"
#include "../inc/zzz2_2.H"
#include "zzz2_3.H"
// Stuff
//---------------------
//=======================================
//=== Part#2.3. $PROJ1_DIR/AAA/inc ======
//=======================================
Header files' content is shown below :
//---------------------
// File aaa1_2.H
#include "zzz1_2.H"
#include "zzz2_2.H"
// Stuff
//---------------------
//---------------------
// File aaa1_3.H
#include "zzz2_3.H"
// Stuff
//---------------------
//---------------------
// File aaa2_2.H
#include "zzz2_3.H"
// Stuff
//---------------------
//---------------------
// File aaa2_3.H
#include "zzz1_3.H"
#include <stdio.h>
// Stuff
//---------------------
//=======================================
//=== Part#2.4. $PROJ1_DIR/AAA/inc ======
//=======================================
Header and source files' content is shown below :
//---------------------
// File aaa1_1.H
#include <set>
#include "zzz1_1.H"
#include "zzz2_1.H"
// Stuff
//---------------------
//---------------------
// File aaa2_1.H
#include <unistd.h>
// Stuff
//---------------------
//---------------------
// File aaa1.C
#include "aaa1_1.H"
#include "../inc/aaa1_2.H"
#include "aaa1_3.H"
// Stuff
//---------------------
//---------------------
// File aaa2.C
#include "aaa2_1.H"
#include "../inc/aaa2_2.H"
#include "aaa2_3.H"
// Stuff
//---------------------
//---------------------
// File aaa_main.C
#include "aaa1_1.H"
#include "aaa1_2.H"
#include "aaa1_3.H"
#include "aaa2_1.H"
#include "aaa2_2.H"
#include "aaa2_3.H"
int main ()
{
// Stuff
return 0;
}
//---------------------
-----------------------------
---> Here are makefiles in progres
-----------------------------
//================================================
//=== Part#3.1. $PROJ1_DIR/COMMON/src/Makefile ===
//================================================
//-------------------------------
3.1.1 COMMON_Makefile_BEFORE_mkmf
//-------------------------------
%cd $PROJ1_DIR/COMMON/src
// Prepare initial Makefile
#########################################################
### COMMON_Makefile_BEFORE_mkmf #########################
### Beginning ###########################################
#########################################################
MAKEFILE = Makefile
SHELL = /bin/sh
DEPEND = makedepend
RM = rm -f
CC = g++
LD = ar r
EGCS_HOME = /tools/EGCS
INCLUDES = -I. \
-I$(PROJ1_DIR)/COMMON/inc \
-I$(EGCS_HOME)/include/g++ \
-I$(EGCS_HOME)/sparc-sun-solaris2.6/include \
-I$(EGCS_HOME)/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include
COMPFLAGS =
C++FLAGS = $(COMPFLAGS) $(INCLUDES)
LDFLAGS =
HDRS =
EXTHDRS =
SRCS =
OBJS =
TARGET = $(PROJ1_DIR)/COMMON/lib/libzzz.a
.SUFFIXES : .h .H .C .c .cpp .o
.C.o :
$(RM) $*.o
$(CC) $(C++FLAGS) -c $<
all: $(TARGET)
$(TARGET): $(OBJS) $(MAKEFILE)
$(RM) $(TARGET)
$(LD) $(TARGET) $(LDFLAGS) $(OBJS)
depend:; $(DEPEND) $(INCLUDES) $(SRCS)
#########################################################
### End #################################################
### COMMON_Makefile_BEFORE_mkmf #########################
#########################################################
//-----------------------------------------------------
3.1.2 COMMON_Makefile_AFTER_mkmf_BUT_BEFORE_make_depend
//-----------------------------------------------------
%mkmf
// Result of the mkmf execution is updated Makefile
#########################################################
### COMMON_Makefile_AFTER_mkmf_BUT_BEFORE_make_depend ###
### Beginning ###########################################
#########################################################
MAKEFILE = Makefile
SHELL = /bin/sh
DEPEND = makedepend
RM = rm -f
CC = g++
LD = ar r
EGCS_HOME = /tools/EGCS
INCLUDES = -I. \
-I$(PROJ1_DIR)/COMMON/inc \
-I$(EGCS_HOME)/include/g++ \
-I$(EGCS_HOME)/sparc-sun-solaris2.6/include \
-I$(EGCS_HOME)/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include
COMPFLAGS =
C++FLAGS = $(COMPFLAGS) $(INCLUDES)
LDFLAGS =
HDRS = zzz1_1.H \
zzz2_1.H
EXTHDRS = ../inc/zzz1_2.H \
../inc/zzz2_2.H
SRCS = zzz1.C \
zzz2.C
OBJS = zzz1.o \
zzz2.o
TARGET = $(PROJ1_DIR)/COMMON/lib/libzzz.a
.SUFFIXES : .h .H .C .c .cpp .o
.C.o :
$(RM) $*.o
$(CC) $(C++FLAGS) -c $<
all: $(TARGET)
$(TARGET): $(OBJS) $(MAKEFILE)
$(RM) $(TARGET)
$(LD) $(TARGET) $(LDFLAGS) $(OBJS)
depend:; $(DEPEND) $(INCLUDES) $(SRCS)
###################################################
###
zzz1.o: zzz1_1.H ../inc/zzz1_2.H
zzz2.o: zzz2_1.H ../inc/zzz2_2.H
#########################################################
### End #################################################
### COMMON_Makefile_AFTER_mkmf_BUT_BEFORE_make_depend ###
#########################################################
Comments.
1. This Makefile holds dependences
of object files (zzz1.o and zzz2.o) on
- zzz1_1.H and zzz2_1.H
because they are in current directory
$PROJ1_DIR/COMMON/src;
(see HDRS in the Makefile)
- ../inc/zzz1_2.H ../inc/zzz2_2.H
because source files (zzz1.C, zzz2.C) hold
explicit paths of zzz1_2.H and zzz2_2.H
(see EXTHDRS in the Makefile),
2. This Makefile file doesn't hold dependences
of object files (zzz1.o and zzz2.o) on
- zzz1_3.H and zzz2_3.H
because source files (zzz1.C, zzz2.C) don't hold
explicit paths of zzz1_3.H and zzz2_3.H
(This Makefile contains no information
concerning zzz1_3.H and zzz2_3.H).
//-------------------------------------
3.1.3 COMMON_Makefile_AFTER_make_depend
//-------------------------------------
%make depend
// Result of the *make depend* execution is updated Makefile
#########################################################
### COMMON_Makefile_AFTER_make_depend ###################
### Beginning ###########################################
#########################################################
MAKEFILE = Makefile
SHELL = /bin/sh
DEPEND = makedepend
RM = rm -f
CC = g++
LD = ar r
EGCS_HOME = /tools/EGCS
INCLUDES = -I. \
-I$(PROJ1_DIR)/COMMON/inc \
-I$(EGCS_HOME)/include/g++ \
-I$(EGCS_HOME)/sparc-sun-solaris2.6/include \
-I$(EGCS_HOME)/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include
COMPFLAGS =
C++FLAGS = $(COMPFLAGS) $(INCLUDES)
LDFLAGS =
HDRS = zzz1_1.H \
zzz2_1.H
EXTHDRS = ../inc/zzz1_2.H \
../inc/zzz2_2.H
SRCS = zzz1.C \
zzz2.C
OBJS = zzz1.o \
zzz2.o
TARGET = $(PROJ1_DIR)/COMMON/lib/libzzz.a
.SUFFIXES : .h .H .C .c .cpp .o
.C.o :
$(RM) $*.o
$(CC) $(C++FLAGS) -c $<
all: $(TARGET)
$(TARGET): $(OBJS) $(MAKEFILE)
$(RM) $(TARGET)
$(LD) $(TARGET) $(LDFLAGS) $(OBJS)
depend:; $(DEPEND) $(INCLUDES) $(SRCS)
###################################################
###
zzz1.o: zzz1_1.H ../inc/zzz1_2.H
zzz2.o: zzz2_1.H ../inc/zzz2_2.H
# DO NOT DELETE
zzz1.o: zzz1_1.H /tools/EGCS/include/g++/map
zzz1.o: /tools/EGCS/include/g++/stl_tree.h
zzz1.o: /tools/EGCS/include/g++/stl_algobase.h
zzz1.o: /tools/EGCS/include/g++/stl_config.h
zzz1.o: /tools/EGCS/include/g++/stl_relops.h
zzz1.o: /tools/EGCS/include/g++/stl_pair.h
zzz1.o: /tools/EGCS/include/g++/type_traits.h /usr/include/string.h
zzz1.o: /usr/include/sys/feature_tests.h
zzz1.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/limits.h
zzz1.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/syslimits.h
zzz1.o: /usr/include/stdlib.h
zzz1.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/stddef.h
zzz1.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/new.h
zzz1.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/new
zzz1.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/exception
zzz1.o: /tools/EGCS/include/g++/iostream.h
zzz1.o: /tools/EGCS/include/g++/streambuf.h
/tools/EGCS/include/g++/libio.h
zzz1.o: /tools/EGCS/sparc-sun-solaris2.6/include/_G_config.h
zzz1.o: /tools/EGCS/include/g++/stl_iterator.h
zzz1.o: /tools/EGCS/include/g++/stl_alloc.h
zzz1.o: /tools/EGCS/sparc-sun-solaris2.6/include/assert.h
zzz1.o: /tools/EGCS/include/g++/stl_construct.h
zzz1.o: /tools/EGCS/include/g++/stl_function.h
zzz1.o: /tools/EGCS/include/g++/stl_map.h
zzz1.o: /tools/EGCS/include/g++/stl_multimap.h ../inc/zzz1_2.H
zzz1.o: /tools/EGCS/include/g++/iostream /tools/EGCS/include/g++/list
zzz1.o: /tools/EGCS/include/g++/stl_uninitialized.h
zzz1.o: /tools/EGCS/include/g++/stl_list.h
zzz1.o: /sun1/users/user1/proj/COMMON/inc/zzz1_3.H
zzz1.o: /tools/EGCS/include/g++/vector
/tools/EGCS/include/g++/stl_vector.h
zzz1.o: /tools/EGCS/include/g++/stl_bvector.h
zzz2.o: zzz2_1.H /usr/include/string.h /usr/include/sys/feature_tests.h
zzz2.o: ../inc/zzz2_2.H /usr/include/stdio.h /usr/include/sys/va_list.h
zzz2.o: /sun1/users/user1/proj/COMMON/inc/zzz2_3.H
zzz2.o: /tools/EGCS/sparc-sun-solaris2.6/include/assert.h
#########################################################
### End #################################################
### COMMON_Makefile_AFTER_make_depend ###################
#########################################################
Comments.
This Makefile holds dependences
of object files (zzz1.o and zzz2.o) on all header files :
1) local header files
- zzz1_1.H and zzz2_1.H (it was after mkmf execution)
- ../inc/zzz1_2.H ../inc/zzz2_2.H (it also was after mkmf
execution)
- zzz1_3.H and zzz2_3.H (it wasn't after mkmf execution)
2) system header files.
//================================================
//=== Part#3.2. $PROJ1_DIR/AAA/src/Makefile ======
//================================================
//----------------------------
3.2.1 AAA_Makefile_BEFORE_mkmf
//----------------------------
%cd $PROJ1_DIR/AAA/src
// Prepare initial Makefile
#########################################################
### AAA_Makefile_BEFORE_mkmf ############################
### Beginning ###########################################
#########################################################
MAKEFILE = Makefile
SHELL = /bin/sh
DEPEND = makedepend
RM = rm -f
CC = g++
LD = g++
EGCS_HOME = /tools/EGCS
INCLUDES = -I. \
-I$(PROJ1_DIR)/AAA/inc \
-I$(PROJ1_DIR)/COMMON/src \
-I$(PROJ1_DIR)/COMMON/inc \
-I$(EGCS_HOME)/include/g++ \
-I$(EGCS_HOME)/sparc-sun-solaris2.6/include \
-I$(EGCS_HOME)/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include
COMPFLAGS =
C++FLAGS = $(COMPFLAGS) $(INCLUDES)
LDFLAGS =
LIBS = $(PROJ1_DIR)/COMMON/lib/libzzz.a
HDRS =
EXTHDRS =
SRCS =
OBJS =
TARGET = $(PROJ1_DIR)/AAA/bin/aaa.out
.SUFFIXES : .h .H .C .c .cpp .o
.C.o :
$(RM) $*.o
$(CC) $(C++FLAGS) -c $<
all: $(TARGET)
$(TARGET): $(OBJS) $(MAKEFILE) $(LIBS)
$(RM) $(TARGET)
$(LD) -o $(TARGET) $(LDFLAGS) $(OBJS) $(LIBS)
depend:; $(DEPEND) $(INCLUDES) $(SRCS)
###################################################
#########################################################
### End #################################################
### AAA_Makefile_BEFORE_mkmf ############################
#########################################################
//--------------------------------------------------
3.2.2 AAA_Makefile_AFTER_mkmf_BUT_BEFORE_make_depend
//--------------------------------------------------
%mkmf
// Result of the mkmf execution is updated Makefile
#########################################################
### AAA_Makefile_AFTER_mkmf_BUT_BEFORE_make_depend ######
### Beginning ###########################################
#########################################################
MAKEFILE = Makefile
SHELL = /bin/sh
DEPEND = makedepend
RM = rm -f
CC = g++
LD = g++
EGCS_HOME = /tools/EGCS
INCLUDES = -I. \
-I$(PROJ1_DIR)/AAA/inc \
-I$(PROJ1_DIR)/COMMON/src \
-I$(PROJ1_DIR)/COMMON/inc \
-I$(EGCS_HOME)/include/g++ \
-I$(EGCS_HOME)/sparc-sun-solaris2.6/include \
-I$(EGCS_HOME)/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include
COMPFLAGS =
C++FLAGS = $(COMPFLAGS) $(INCLUDES)
LDFLAGS =
LIBS = $(PROJ1_DIR)/COMMON/lib/libzzz.a
HDRS = aaa1_1.H \
aaa2_1.H
EXTHDRS = ../inc/aaa1_2.H \
../inc/aaa2_2.H
SRCS = aaa1.C \
aaa2.C \
aaa_main.C
OBJS = aaa1.o \
aaa2.o \
aaa_main.o
TARGET = $(PROJ1_DIR)/AAA/bin/aaa.out
.SUFFIXES : .h .H .C .c .cpp .o
.C.o :
$(RM) $*.o
$(CC) $(C++FLAGS) -c $<
all: $(TARGET)
$(TARGET): $(OBJS) $(MAKEFILE) $(LIBS)
$(RM) $(TARGET)
$(LD) -o $(TARGET) $(LDFLAGS) $(OBJS) $(LIBS)
depend:; $(DEPEND) $(INCLUDES) $(SRCS)
###################################################
###
aaa1.o: aaa1_1.H ../inc/aaa1_2.H
aaa2.o: aaa2_1.H ../inc/aaa2_2.H
aaa_main.o: aaa1_1.H aaa2_1.H
#########################################################
### End #################################################
### AAA_Makefile_AFTER_mkmf_BUT_BEFORE_make_depend ######
#########################################################
Comments.
1. This Makefile file holds dependences
of object files (aaa1.o, aaa2.o, aaa_main.o) on
- aaa1_1.H and aaa2_1.H
because they are in current directory
$PROJ1_DIR/COMMON/src;
(see HDRS in the Makefile)
- ../inc/aaa1_2.H ../inc/aaa2_2.H
because source files (aaa1.C, aaa2.C, aaa_main.C) hold
explicit paths of aaa1_2.H and aaa2_2.H
(see EXTHDRS in the Makefile),
2. This Makefile file doesn't hold dependences
of object files (aaa1.o, aaa2.o, aaa_main.o) on
- aaa1_3.H and aaa2_3.H
because source files (aaa1.C, aaa2.C, aaa_main.C) don't
hold
explicit paths of aaa1_3.H and aaa2_3.H
(This Makefile contains no information
concerning aaa1_3.H and aaa2_3.H);
3. This Makefile file doesn't hold dependences
of object files (aaa1.o, aaa2.o, aaa_main.o) on
library header files
- zzz1_1.H, zzz1_2.H, zzz1_3.H,
zzz2_1.H, zzz2_2.H, zzz2_3.H
because header files
aaa1_1.H, aaa1_2.H, aaa2_1.H, aaa2_2.H
don't hold explicit paths of
zzz1_1.H, zzz1_2.H, zzz1_3.H,
zzz2_1.H, zzz2_2.H, zzz2_3.H.
//----------------------------------
3.2.3 AAA_Makefile_AFTER_make_depend
//----------------------------------
%make depend
// Result of the *make depend* execution is updated Makefile
#########################################################
### AAA_Makefile_AFTER_make_depend ######################
### Beginning ###########################################
#########################################################
MAKEFILE = Makefile
SHELL = /bin/sh
DEPEND = makedepend
RM = rm -f
CC = g++
LD = g++
EGCS_HOME = /tools/EGCS
INCLUDES = -I. \
-I$(PROJ1_DIR)/AAA/inc \
-I$(PROJ1_DIR)/COMMON/src \
-I$(PROJ1_DIR)/COMMON/inc \
-I$(EGCS_HOME)/include/g++ \
-I$(EGCS_HOME)/sparc-sun-solaris2.6/include \
-I$(EGCS_HOME)/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include
COMPFLAGS =
C++FLAGS = $(COMPFLAGS) $(INCLUDES)
LDFLAGS =
LIBS = $(PROJ1_DIR)/COMMON/lib/libzzz.a
HDRS = aaa1_1.H \
aaa2_1.H
EXTHDRS = ../inc/aaa1_2.H \
../inc/aaa2_2.H
SRCS = aaa1.C \
aaa2.C \
aaa_main.C
OBJS = aaa1.o \
aaa2.o \
aaa_main.o
TARGET = $(PROJ1_DIR)/AAA/bin/aaa.out
.SUFFIXES : .h .H .C .c .cpp .o
.C.o :
$(RM) $*.o
$(CC) $(C++FLAGS) -c $<
all: $(TARGET)
$(TARGET): $(OBJS) $(MAKEFILE) $(LIBS)
$(RM) $(TARGET)
$(LD) -o $(TARGET) $(LDFLAGS) $(OBJS) $(LIBS)
depend:; $(DEPEND) $(INCLUDES) $(SRCS)
###################################################
###
aaa1.o: aaa1_1.H ../inc/aaa1_2.H
aaa2.o: aaa2_1.H ../inc/aaa2_2.H
aaa_main.o: aaa1_1.H aaa2_1.H
# DO NOT DELETE
aaa1.o: aaa1_1.H /tools/EGCS/include/g++/set
aaa1.o: /tools/EGCS/include/g++/stl_tree.h
aaa1.o: /tools/EGCS/include/g++/stl_algobase.h
aaa1.o: /tools/EGCS/include/g++/stl_config.h
aaa1.o: /tools/EGCS/include/g++/stl_relops.h
aaa1.o: /tools/EGCS/include/g++/stl_pair.h
aaa1.o: /tools/EGCS/include/g++/type_traits.h /usr/include/string.h
aaa1.o: /usr/include/sys/feature_tests.h
aaa1.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/limits.h
aaa1.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/syslimits.h
aaa1.o: /usr/include/stdlib.h
aaa1.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/stddef.h
aaa1.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/new.h
aaa1.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/new
aaa1.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/exception
aaa1.o: /tools/EGCS/include/g++/iostream.h
aaa1.o: /tools/EGCS/include/g++/streambuf.h
/tools/EGCS/include/g++/libio.h
aaa1.o: /tools/EGCS/sparc-sun-solaris2.6/include/_G_config.h
aaa1.o: /tools/EGCS/include/g++/stl_iterator.h
aaa1.o: /tools/EGCS/include/g++/stl_alloc.h
aaa1.o: /tools/EGCS/sparc-sun-solaris2.6/include/assert.h
aaa1.o: /tools/EGCS/include/g++/stl_construct.h
aaa1.o: /tools/EGCS/include/g++/stl_function.h
aaa1.o: /tools/EGCS/include/g++/stl_set.h
aaa1.o: /tools/EGCS/include/g++/stl_multiset.h
aaa1.o: /sun1/users/user1/proj/COMMON/src/zzz1_1.H
aaa1.o: /tools/EGCS/include/g++/map /tools/EGCS/include/g++/stl_map.h
aaa1.o: /tools/EGCS/include/g++/stl_multimap.h
aaa1.o: /sun1/users/user1/proj/COMMON/src/zzz2_1.H
aaa1.o: ../inc/aaa1_2.H
aaa1.o: /sun1/users/user1/proj/COMMON/inc/zzz1_2.H
aaa1.o: /tools/EGCS/include/g++/iostream /tools/EGCS/include/g++/list
aaa1.o: /tools/EGCS/include/g++/stl_uninitialized.h
aaa1.o: /tools/EGCS/include/g++/stl_list.h
aaa1.o: /sun1/users/user1/proj/COMMON/inc/zzz2_2.H
aaa1.o: /usr/include/stdio.h /usr/include/sys/va_list.h
aaa1.o: /sun1/users/user1/proj/AAA/inc/aaa1_3.H
aaa1.o: /sun1/users/user1/proj/COMMON/inc/zzz2_3.H
aaa2.o: aaa2_1.H /usr/include/unistd.h /usr/include/sys/feature_tests.h
aaa2.o: /usr/include/sys/types.h /usr/include/sys/isa_defs.h
aaa2.o: /usr/include/sys/machtypes.h /usr/include/sys/int_types.h
aaa2.o: /usr/include/sys/select.h /usr/include/sys/time.h
aaa2.o: /usr/include/sys/time.h /usr/include/sys/unistd.h
../inc/aaa2_2.H
aaa2.o: /sun1/users/user1/proj/COMMON/inc/zzz2_3.H
aaa2.o: /tools/EGCS/sparc-sun-solaris2.6/include/assert.h
aaa2.o: /sun1/users/user1/proj/AAA/inc/aaa2_3.H
aaa2.o: /sun1/users/user1/proj/COMMON/inc/zzz1_3.H
aaa2.o: /tools/EGCS/include/g++/vector
/tools/EGCS/include/g++/stl_algobase.h
aaa2.o: /tools/EGCS/include/g++/stl_config.h
aaa2.o: /tools/EGCS/include/g++/stl_relops.h
aaa2.o: /tools/EGCS/include/g++/stl_pair.h
aaa2.o: /tools/EGCS/include/g++/type_traits.h /usr/include/string.h
aaa2.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/limits.h
aaa2.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/syslimits.h
aaa2.o: /usr/include/stdlib.h
aaa2.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/stddef.h
aaa2.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/new.h
aaa2.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/new
aaa2.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/exception
aaa2.o: /tools/EGCS/include/g++/iostream.h
aaa2.o: /tools/EGCS/include/g++/streambuf.h
/tools/EGCS/include/g++/libio.h
aaa2.o: /tools/EGCS/sparc-sun-solaris2.6/include/_G_config.h
aaa2.o: /tools/EGCS/include/g++/stl_iterator.h
aaa2.o: /tools/EGCS/include/g++/stl_alloc.h
aaa2.o: /tools/EGCS/include/g++/stl_construct.h
aaa2.o: /tools/EGCS/include/g++/stl_uninitialized.h
aaa2.o: /tools/EGCS/include/g++/stl_vector.h
aaa2.o: /tools/EGCS/include/g++/stl_bvector.h /usr/include/stdio.h
aaa2.o: /usr/include/sys/va_list.h
aaa_main.o: aaa1_1.H /tools/EGCS/include/g++/set
aaa_main.o: /tools/EGCS/include/g++/stl_tree.h
aaa_main.o: /tools/EGCS/include/g++/stl_algobase.h
aaa_main.o: /tools/EGCS/include/g++/stl_config.h
aaa_main.o: /tools/EGCS/include/g++/stl_relops.h
aaa_main.o: /tools/EGCS/include/g++/stl_pair.h
aaa_main.o: /tools/EGCS/include/g++/type_traits.h /usr/include/string.h
aaa_main.o: /usr/include/sys/feature_tests.h
aaa_main.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/limits.h
aaa_main.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/syslimits.h
aaa_main.o: /usr/include/stdlib.h
aaa_main.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/stddef.h
aaa_main.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/new.h
aaa_main.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/new
aaa_main.o:
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include/exception
aaa_main.o: /tools/EGCS/include/g++/iostream.h
aaa_main.o: /tools/EGCS/include/g++/streambuf.h
aaa_main.o: /tools/EGCS/include/g++/libio.h
aaa_main.o: /tools/EGCS/sparc-sun-solaris2.6/include/_G_config.h
aaa_main.o: /tools/EGCS/include/g++/stl_iterator.h
aaa_main.o: /tools/EGCS/include/g++/stl_alloc.h
aaa_main.o: /tools/EGCS/sparc-sun-solaris2.6/include/assert.h
aaa_main.o: /tools/EGCS/include/g++/stl_construct.h
aaa_main.o: /tools/EGCS/include/g++/stl_function.h
aaa_main.o: /tools/EGCS/include/g++/stl_set.h
aaa_main.o: /tools/EGCS/include/g++/stl_multiset.h
aaa_main.o: /sun1/users/user1/proj/COMMON/src/zzz1_1.H
aaa_main.o: /tools/EGCS/include/g++/map
/tools/EGCS/include/g++/stl_map.h
aaa_main.o: /tools/EGCS/include/g++/stl_multimap.h
aaa_main.o: /sun1/users/user1/proj/COMMON/src/zzz2_1.H
aaa_main.o: /sun1/users/user1/proj/AAA/inc/aaa1_2.H
aaa_main.o: /sun1/users/user1/proj/COMMON/inc/zzz1_2.H
aaa_main.o: /tools/EGCS/include/g++/iostream
/tools/EGCS/include/g++/list
aaa_main.o: /tools/EGCS/include/g++/stl_uninitialized.h
aaa_main.o: /tools/EGCS/include/g++/stl_list.h
aaa_main.o: /sun1/users/user1/proj/COMMON/inc/zzz2_2.H
aaa_main.o: /usr/include/stdio.h /usr/include/sys/va_list.h
aaa_main.o: /sun1/users/user1/proj/AAA/inc/aaa1_3.H
aaa_main.o: /sun1/users/user1/proj/COMMON/inc/zzz2_3.H
aaa_main.o: aaa2_1.H /usr/include/unistd.h /usr/include/sys/types.h
aaa_main.o: /usr/include/sys/isa_defs.h /usr/include/sys/machtypes.h
aaa_main.o: /usr/include/sys/int_types.h /usr/include/sys/select.h
aaa_main.o: /usr/include/sys/time.h /usr/include/sys/time.h
aaa_main.o: /usr/include/sys/unistd.h
aaa_main.o: /sun1/users/user1/proj/AAA/inc/aaa2_2.H
aaa_main.o: /sun1/users/user1/proj/AAA/inc/aaa2_3.H
aaa_main.o: /sun1/users/user1/proj/COMMON/inc/zzz1_3.H
aaa_main.o: /tools/EGCS/include/g++/vector
aaa_main.o: /tools/EGCS/include/g++/stl_vector.h
aaa_main.o: /tools/EGCS/include/g++/stl_bvector.h
#########################################################
### End #################################################
### AAA_Makefile_AFTER_make_depend ######################
#########################################################
Comments.
This Makefile holds dependences
of object files (aaa1.o, aaa2.o, aaa_main.o) on all header files
:
1) local header files
- aaa1_1.H and aaa2_1.H (it was after mkmf execution)
- ../inc/aaa1_2.H ../inc/aaa2_2.H (it was after mkmf
execution)
- aaa1_3.H and aaa2_3.H (it wasn't after mkmf execution)
2) library header files
- zzz1_1.H, zzz1_2.H, zzz1_3.H,
zzz2_1.H, zzz2_2.H, zzz2_3.H
(it wasn't after mkmf execution)
3) system header files.
//================================================
//=== Part#4. Appendix ===========================
//=========== HP and SUN workstations ============
//================================================
The project is being developed on SunOS 5.6.
The mkmf command exists on HP-UX 10,
but I haven't found out something like mkmf
on SunOS 5.6.
I'm working in local network that contains
both HP-workstations and SUN-workstations.
That enables to create required Makefiles.
So, here are steps of preparing
$PROJ1_DIR/COMMON/src/Makefile and
$PROJ1_DIR/AAA/src/Makefile.
//========================================
[SUN_workstation1] <1> setenv PROJ1_DIR /sun1/users/user1/proj
//--------------------
//--------------------
[SUN_workstation1] <2> cd $PROJ1_DIR/COMMON/src
[SUN_workstation1] <3> vi Makefile // Prepare initial
$PROJ1_DIR/COMMON/src/Makefile
[SUN_workstation1] <4> rlogin HP_workstation1
//--------------------
[HP_workstation1] <1> setenv PROJ1_DIR /sun1/users/user1/proj
[HP_workstation1] <2> cd $PROJ1_DIR/COMMON/src
[HP_workstation1] <3> mkmf // $PROJ1_DIR/COMMON/src/Makefile updated
[HP_workstation1] <4> logout
//--------------------
[SUN_workstation1] <5> make depend // $PROJ1_DIR/COMMON/src/Makefile
created
//--------------------
//--------------------
[SUN_workstation1] <6> cd $PROJ1_DIR/AAA/src
[SUN_workstation1] <7> vi Makefile // Prepare initial
$PROJ1_DIR/AAA/src/Makefile updated
[SUN_workstation1] <8> rlogin HP_workstation1
//--------------------
[HP_workstation1] <1> setenv PROJ1_DIR /sun1/users/user1/proj
[HP_workstation1] <2> cd $PROJ1_DIR/AAA/src
[HP_workstation1] <3> mkmf // $PROJ1_DIR/AAA/src/Makefile updated
[HP_workstation1] <4> logout
//--------------------
[SUN_workstation1] <9> make depend // $PROJ1_DIR/AAA/src/Makefile
created
//========================================
//================================================
//=== Part#5. Compilation ========================
//================================================
//-----------------------
%cd $PROJ1_DIR/COMMON/src
%make
rm -f zzz1.o
g++ -I. -I/sun1/users/user1/proj/COMMON/inc
-I/tools/EGCS/include/g++ -I/tools/EGCS/sparc-sun-solaris2.6/include
-I/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include -c
zzz1.C
rm -f zzz2.o
g++ -I. -I/sun1/users/user1/proj/COMMON/inc
-I/tools/EGCS/include/g++ -I/tools/EGCS/sparc-sun-solaris2.6/include
-I/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include -c
zzz2.C
rm -f /sun1/users/user1/proj/COMMON/lib/libzzz.a
ar r /sun1/users/user1/proj/COMMON/lib/libzzz.a zzz1.o zzz2.o
%touch $PROJ1_DIR/COMMON/inc/zzz1_3.H
%make
rm -f zzz1.o
g++ -I. -I/sun1/users/user1/proj/COMMON/inc
-I/tools/EGCS/include/g++ -I/tools/EGCS/sparc-sun-solaris2.6/include
-I/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include -c
zzz1.C
rm -f /sun1/users/user1/proj/COMMON/lib/libzzz.a
ar r /sun1/users/user1/proj/COMMON/lib/libzzz.a zzz1.o zzz2.o
//-----------------------
%cd $PROJ1_DIR/AAA/src
%make
rm -f aaa1.o
g++ -I. -I/sun1/users/user1/proj/AAA/inc
-I/sun1/users/user1/proj/COMMON/src -I/sun1/users/user1/proj/COMMON/inc
-I/tools/EGCS/include/g++ -I/tools/EGCS/sparc-sun-solaris2.6/include
-I/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include -c
aaa1.C
rm -f aaa2.o
g++ -I. -I/sun1/users/user1/proj/AAA/inc
-I/sun1/users/user1/proj/COMMON/src -I/sun1/users/user1/proj/COMMON/inc
-I/tools/EGCS/include/g++ -I/tools/EGCS/sparc-sun-solaris2.6/include
-I/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include -c
aaa2.C
rm -f aaa_main.o
g++ -I. -I/sun1/users/user1/proj/AAA/inc
-I/sun1/users/user1/proj/COMMON/src -I/sun1/users/user1/proj/COMMON/inc
-I/tools/EGCS/include/g++ -I/tools/EGCS/sparc-sun-solaris2.6/include
-I/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include -c
aaa_main.C
rm -f /sun1/users/user1/proj/AAA/bin/aaa.out
g++ -o /sun1/users/user1/proj/AAA/bin/aaa.out aaa1.o aaa2.o
aaa_main.o /sun1/users/user1/proj/COMMON/lib/libzzz.a
%touch $PROJ1_DIR/AAA/inc/aaa1_2.H
%make
rm -f aaa1.o
g++ -I. -I/sun1/users/user1/proj/AAA/inc
-I/sun1/users/user1/proj/COMMON/src -I/sun1/users/user1/proj/COMMON/inc
-I/tools/EGCS/include/g++ -I/tools/EGCS/sparc-sun-solaris2.6/include
-I/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include -c
aaa1.C
rm -f aaa_main.o
g++ -I. -I/sun1/users/user1/proj/AAA/inc
-I/sun1/users/user1/proj/COMMON/src -I/sun1/users/user1/proj/COMMON/inc
-I/tools/EGCS/include/g++ -I/tools/EGCS/sparc-sun-solaris2.6/include
-I/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include -c
aaa_main.C
rm -f /sun1/users/user1/proj/AAA/bin/aaa.out
g++ -o /sun1/users/user1/proj/AAA/bin/aaa.out aaa1.o aaa2.o
aaa_main.o /sun1/users/user1/proj/COMMON/lib/libzzz.a
%touch $PROJ1_DIR/COMMON/inc/zzz1_3.H
%make
rm -f aaa2.o
g++ -I. -I/sun1/users/user1/proj/AAA/inc
-I/sun1/users/user1/proj/COMMON/src -I/sun1/users/user1/proj/COMMON/inc
-I/tools/EGCS/include/g++ -I/tools/EGCS/sparc-sun-solaris2.6/include
-I/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include -c
aaa2.C
rm -f aaa_main.o
g++ -I. -I/sun1/users/user1/proj/AAA/inc
-I/sun1/users/user1/proj/COMMON/src -I/sun1/users/user1/proj/COMMON/inc
-I/tools/EGCS/include/g++ -I/tools/EGCS/sparc-sun-solaris2.6/include
-I/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include -c
aaa_main.C
rm -f /sun1/users/user1/proj/AAA/bin/aaa.out
g++ -o /sun1/users/user1/proj/AAA/bin/aaa.out aaa1.o aaa2.o
aaa_main.o /sun1/users/user1/proj/COMMON/lib/libzzz.a
%touch $PROJ1_DIR/COMMON/lib/libzzz.a
rm -f /sun1/users/user1/proj/AAA/bin/aaa.out
g++ -o /sun1/users/user1/proj/AAA/bin/aaa.out aaa1.o aaa2.o
aaa_main.o /sun1/users/user1/proj/COMMON/lib/libzzz.a
//================================================
//=== Part#6. Environment ========================
//================================================
// HP
uname -sr : HP-UX B.10.20
what /bin/mkmf : $Revision: 74.1 $
// SUN
uname -sr : SunOS 5.6
//================================================
#####################################################
############# END OF MESSAGE ########################
#####################################################
Sent via Deja.com http://www.deja.com/
Before you buy.