$Id: README.Imake,v 1.1.1.1 1998/08/18 22:06:47 k2krep Exp $ $XConsortium: README,v 1.37.1.1 95/07/06 13:57:09 kaleb Exp $ The easiest way to write an Imakefile is to find another one that does something similar and copy/modify it! There is a long torrid history associated with these config files. They were copied from CERN and modified. The CERN imake config files were copied from X11 and modified. The X11 imake config files were copied from X10 and modified. The X10 imake config files... REQUIRED SOFTWARE: imake -- Must be compadible with the X11R6 version. The version distributed with openwin is broken. make -- These config files require the GNUmake version of make. This is often named gmake to avoid conflict with vendor make's. You can check the version with "make -v". cpp -- If you c preprocessor is not in /usr/lib/cpp you may need to set the IMAKECPP environment to point to it. ENVIRONMENT VARIABLES: These variables control how imake behaves. Some of them need to be set before you can use Imake. CVSCOSRC -- Where to find the imake config files. The MUST be set before you can use imake_boot and make. It will usually be set in your imake.cshrc or imake.profile which is sourced at login. PRIVATE_ROOT -- Define where to install your working copies. This is the "root" of the directories that you use to debug your code. It is usually set to ${HOME} when you source imake.cshrc, but is optional. If you define it to be something else before source the imake.cshrc then that value is accepted. To install into a group directory, you must "unset" PRIVATE_ROOT. MACHINE -- The type of machine you are using and where to put the machine specific files. This variable is set in the imake.cshrc file. EXPERIMENT -- Define where to find the general experiment libraries. This will usually be set to a group directory like "/skam" or "/home/E362". The rest of the environment variables are optional. EXPERIMENT_LEVEL -- The release level to use for the experiment libraries. This is usually "new". PACKAGE -- Define where to find the "package" libraries. For example, in Mozumi the high energy group sets PACKAGE to "/home/atmpd". If PRIVATE_ROOT is not defined, then this sets where to install files. PACKAGE_LEVEL -- The release level to use for the package library. This is usually "new". IMAKECPP -- Specify the c preprocessor to use. This is used as a last resort to help imake find cpp. INSTALLING CONFIG FILES: If your account is set up for CVS, then theimake config files are installed by doing a "cvs get config" in your lib directory (or where ever you decide to put them. EG: sukai:~$ mkdir lib sukai:~$ cd lib sukai:~/lib$ cvs get config Change directory to the config/site_definitions and find the appropriate .def file. If you don't find an appropriate definitions file, then copy site.def to a file that specifies your site and edit the new copy. You will find directions in the file as you edit it. sukai:~/lib$ cd config/site_definitions sukai:~/lib/config/site_definitions$ ls CVS/ pnasun.def site.sample sukus.def pnahp.def site.def sukai.def Make a symbolic link to the appropriate file in site_definitions: sukai:~/lib/config/site_definitions$ cd .. sukai:~/lib/config$ ln -s ./site_definitions/sukai.def ./site.def Execute the install.imake file in the new config subdirectory: sukai:~/lib/config$ ./install.imake By default, this will install files into your ${HOME}/bin directory. If PRIVATE_PATH or EXPERIMENT are defined it will install into those directorys *if* they are writable. Edit your .login or .profile file to define the EXPERIMENT environment variable (see above) and source the imake set up file. csh: source ${HOME}/bin/imake.cshrc sh: . ${HOME}/bin/imake.profile Depending on your local set up, you maybe able to use: csh: source ${EXPERIMENT}/bin/imake.cshrc sh: . ${EXPERIMENT}/bin/imake.profile INSTALLED FILES: The files imake_boot, imake.profile and imake.cshrc files are installed into a bin directory. Usually these files are either in your ${HOME}/bin directory or the ${EXPERIMENT}/bin directory. imake_boot -- Create the first Makefile from an Imakefile. To remake a Makefile use "make Makefile". For the old off-site group members, imake_boot replaces imboot. imake.cshrc or imake.profile -- One of these should be sourced in your .cshrc or .profile file (Use the one appropriate to your shell). These set up the environment variables. If you don't like the defaults chosen in these files, you can override them before the file is sourced. USING IMAKE: For the old off-site group members, these imake config files are compatible with the existing Imakefiles so you know how to use them. The easiest way to write an Imakefile is to find another one that does something similar and copy/modify it! Here's an example of a simple Imakefile that builds a small library, installs an include file, and an executable. ******************************************** cat < Imakefile XCOMM This is an example Imakefile. This is a comment line. XCOMM The library objects. OBJS = a.o b.o c.o XCOMM This creates libd.a NormalLibraryTarget(d,$(OBJS)) XCOMM This compiles a program named e using e.o, the local libd.a and XCOMM libsk.a with cernlib NormalProgramTarget(e,e.o libd.a,,-lsk `cernlib`,) XCOMM This installs libd.a InstallLibrary(d,$(LIBDIR)) XCOMM This installs the program "e" InstallProgram(e,$(BINDIR)) XCOMM This installs a C include file named c.h InstallInclude(c.h,$(INCDIR)) XCOMM This installs a Fortran include file named f.inc InstallInclude(f.inc,$(FORTRAN_INCDIR)) /EOF/ **************************************** You can find a copy of this file in your config directory, named "Imakefile.example". To find out about the gory details of the internal workings of Imake, there is a book titled "Software Portability using Imake" in the US office in Mozumi, or at your local Barne's and Noble's. It's published by O'Rielly. To build an initial Makefile from an Imakefile, run imake_boot (you installed it when you installed Imake). After you have generated an initial Makefile, you should refresh it using "make Makefile" since that remembers stuff about how the code should be built. USING MAKE Important note: These Makefiles *require* GNUmake. You can make sure it's installed with "make -v" or "gmake -v". If you have GNUmake, then you will get a version messages that says this is "GNU make"/ Here's a really quick tutorial for the make targets created by this version of Imake. This assumes that you know how to run make. If you don't, then please ask somebody to show you. This section assumes that you have already built the initial Makefile from the Imakefile. If you have not, then create it but running imake_boot. * Updating the Makefile after you've changed the Imakefile: make Makefile This is the best way to refresh you Makefile since it remembers information about how the Makefile was originally built. This can be important if the Makefile was generated via a recursive Makefiles command. * Build the Makefiles in the subdirectories: make Makefiles This traverses the directory tree looking for Imakefiles that need to be made into Makefiles * Build the include files from language independent files or from other include files: make includes * Install the include files into the correct locations: make install.includes This usually has to be done before you can do a make all. * Build all of the objects and libraries. make all * Install the objects and libraries into the correct locations: make install This usually has to be done before you can do a make exec. * Make the executables make exec * Install the executables make install.exec. * Compendium of Targets created by Imake emptyrule: -- The default rule that does nothing. Makefile: -- Regenerate the Makefile Makefiles: -- Recursively build the Makefiles includes: -- build any include files from source. all: -- Compile the objects and libraries. exec: -- Compile and link the executables. clean; -- Clean out files that can be rebuilt. tags: -- Generate a tags file. depend: -- Build the dependencies. install: -- Install the objects, data files and libraries install.lib: -- Install just the libraries. install.man: -- Install the manual files install.include: - Install the include files. install.exec: -- Install the executable files. QUESTIONS ANSWERED: If you've read this document and you still can't find the answer, then it's probably Clark McGrew's fault. The best solution is to send your question to him at "clark.mcgrew@sunysb.edu", but please only ask questions about IMAKE because he doesn't know much about anything else. THE END $Log: README.Imake,v $ Revision 1.1.1.1 1998/08/18 22:06:47 k2krep Offline Web page contents are here. This part is controlled by JOS:) consept. you need to add every progress of you by using CVS add/update/commit. See http://neutrino.kek.jp/~k2k/ofl for detail, where the newest contents of this modules are in. Revision 1.4 1997/05/18 09:42:04 mcgrew Extend the readme so that it has directions for how to use the Makefiles. This version also has a little better description of how to install the config files and what to do if you can not find a site.def file for your site. Revision 1.3 1997/05/14 06:15:39 mcgrew This is a reasonable set of directions for installing and using Imake. There are still some weak parts, but they'll be fixed later. # Revision 1.2 1997/05/14 03:13:30 mcgrew # Add new documentation and make it easier to set up imake. # Revision 1.1.1.1 1997/04/26 08:45:49 mcgrew import config files Revision 1.2 1996/04/02 21:02:27 thakulin Add entries for HasApogee and HasEPC macros. Revision 1.1.1.1 1995/12/20 15:26:45 cernlib X11R6 config files unmodified