# Application Include Makefile for the application called `app'. # Add some C and C++ compilation flags for our application. ] # (-g -- include debugging info, -pg -- include profiling support for gprof) LOCAL_CFLAGS = -g -pg # Define APPDIR APPDIR = /home/manta/app # Include the generic Makefile definitions include /home/manta/rcslib/etc/generic.def
(To follow the Enhanced Machine Controller(EMC) convention, Makefile.app should be placed in the top-level directory.)
# Top-Level Makefile for the application called `app'. # Include the Application Include Makefile include Makefile.app # To build any of these phony targets go to each subdirectory and run make. clean depend install all headers sources: (cd src/sub_directory1; $(MAKE) -k $@) (cd src/sub_directory2; $(MAKE) -k $@) (cd src/sub_directory3; $(MAKE) -k $@)
# Makefile for sub_directory1 of the application called `app'. # Set the variables required by generic.def SOURCES = example1.cc example2.cc example3.cc OBJS = example1.o example2.o example3.o LIBS = ifeq (vxworks,$(findstring vxworks,$(PLAT))) BINS = else BINS = example_bin endif # Include the Application Include Makefile include ../../Makefile.app # Create rules to link together specific binaries. $(DEVP_PLAT_BIN)/example_bin: \ $(DEVP_PLAT_LIB)/example1.o \ $(DEVP_PLAT_LIB)/example2.o \ $(DEVP_PLAT_LIB)/example1.o ($(COMPILER_SETUP); \ $(CPLUSPLUS) $(CFLAGS) $(CPLUSPLUSFLAGS) $(CLINK) $(CPLUSPLUSLINK) $^ -o $@;)
VARIABLE | Where Set? | Meaning |
---|---|---|
APPDIR | Application Include Makefile | Specifies the main application directory, which is used in the INCLUDE path and for performing an install when the application is ready to be released. |
AR | $(PLAT).def | Provides the name and path of the library archiver for the given platform. (See the ar manpage.) |
BINS | Subdirectory Makefile | Lists the executable binary files that should be created by running make in this subdirectory. Binaries will need to have a separate rule at the end of the makefile. |
CC | $(PLAT).def | Provides the name and path of the C compiler for the given platform. |
CPLUSPLUS | $(PLAT).def | Provides the name and path of the C++ compiler for the given platform. |
COMPILER_SETUP | $(PLAT).def | Provides the command(s) required to setup the environment so the compiler and related tools can be used. It should be used at the beginning of commands in rules for specific binaries and libraries. |
DEVP_PLAT_BIN | generic.def | Provides the name of the directory where executable binary files should land within the programmer's workspace. It should be used to provide rules for specific binaries. |
DEVP_PLAT_LIB | generic.def | Provides the name of the directory where object files and libraries should land within the programmer's workspace. It should be used to provide rules for specific binaries and libraries. |
HEADERS | Subdirectory Makefile | Lists the header files found in this directory that should be copied to the platform include directory so that they may be used from other directories or by other programmers. |
LIBS | Subdirectory Makefile | Lists the library files that should be created by running make in this subdirectory. Libraries will need to have a separate rule at the end of the makefile. |
LOCAL_CFLAGS | Application Include Makefile | Lists options that will be passed to the C or C++ compiler. |
LOCAL_CPLUSPLUSFLAGS | Application Include Makefile | Lists options that will be passed to the C++ compiler. (not to a C compiler) |
OBJS | Subdirectory Makefile | Lists the object files that should be compiled by running make in this subdirectory. |
PLAT | Command Line | Specifies which platform to compile for. It is normally set on the command line so that programmers can easily switch between multiple compilers and cross-compilers. It defaults to the value of the osrev environment variable. |
RANLIB | $(PLAT).def | Provides the name and path of the ranlib utility for the given platform if one exists and is required, otherwise the variable contains some command that should have no effect. The ranlib utility converts archives to random libraries. (See the ranlib manpage.) |
RCS_INCLUDE | generic.def | Provides the directory where header files for the RCS library are placed. |
RCS_LIBRARY | generic.def | Provides the name and path of the RCS Library for the platform set with PLAT. |
RCS_PLATLIB | generic.def | Provides the path to the RCS Library for the platform set with PLAT. This is also the location of the pmac and pcio libraries if they exist for the platform. |
SOURCES | Subdirectory Makefile | Lists the C and C++ files used from that subdirectory. C files should have the .c extension and C++ files should have the .cc extension. Thie list is used for creating automatic dependency lists and for storing archives of the source code during an install. Do not list header files here. |
USER_DIR | Programmer's Environment, Application Include Makefile, or command line | Specifies the top-level directory in the programmer's workspace. It defaults to the name of the application under the programmer's home directory. It is recommended that the applications be set up so that the default can be used and USER_DIR need not be set. For example: If APPDIR=/home/manta/emc and the programmer's login name was "shackle" then the workspace should be placed in ~shackle/emc to match the default. |
Target Name | Purpose |
---|---|
all | Update everything within the programmer's workspace, including copying header files to the include directory, compiling, linking and archiving as necessary. |
clean | Deletes object files and programs from the programmer's workspace. This is useful for example when a change in compiler options would not take effect unless the entire application is rebuilt. |
depend | Generate lists of dependencies so that files will be recompiled whenever a header file they include directly or indirectly has changed (uses the makedepend utility). |
headers | Copies the header files to the src and include subdirectory of the current platform directory. For Windows and DOS platforms the files are also converted with unix2dos. |
install | Copy all the source, header, object files, libraries and programs from the programmer's workspace to the main application release the main application directory. |
sources | Copies the source and header files to the src and include subdirectories of the current platform directory. For Windows and DOS platforms the files are also converted with unix2dos and the .cc extension is replaced with .cpp. |
Last Modified: 04/02/98
If you have questions or comments regarding this page or you would like to be notified of changes to the RCS library via email, please contact Will Shackleford at shackle@cme.nist.gov