next up previous contents
Next: Using ordinary UNIX command Up: Building applications ported to Previous: Building applications ported to

Using the generic makefile

The RSIM distribution contains a generic makefile that can be used for building applications. This generic makefile includes all the needed steps for compiling, linking, and predecoding applications to be simulated. If needed, the generic makefile also expands the RSIM PARMACS macros in source files with the suffixes .C, .U, and .H (as appear in the SPLASH and SPLASH-2 applications). Invocation of the unelf command is not included in the generic makefile, as this command is only used on some target systems; thus, this command must be invoked separately if the user intends to run RSIM on non-ELF host platforms.

The generic makefile is in apps/utils/lib/makefile_generic in rsim-1.0. This makefile uses rules specified according to the rules of the Sun make utility for Solaris. At installation time, the fully-specified pathname of the directory in which this file is located should be inserted in the LIBDIR variable of the makefile (This field is set by default to /home/rsim/rsim-1.0/apps/utils/lib).

Makefiles for a specific application can include the generic makefile, so long as they define the SRC, HEADERS, and TARGET variables. The generic makefile assumes that the application-specific makefile is located in the top-level directory for a given application, that all source and header files are located in the src directory of the application, that the relocatable object files will be placed in the obj directory, and that the linked and predecoded executables will be in the execs directory of the application. For example, if an application consisted of the source files src/source1.c and src/source2.c, the header files src/header1.h and src/header2.h, and seeks to produce a predecoded executable named execs/app_rc.out.dec, the application makefile should simply read:

SRC = source1 source2
HEADERS = header1 header2
TARGET = app

include ../../utils/lib/makefile.generic

Then, to actually construct the desired predecoded executable, the user should type the following from the application directory:

prompt% make execs/app_rc.out.dec

Once the generic makefile is invoked, it will expand the PARMACS macros (if needed) in the source files, and compile, link, and predecode the target.

Note that with the generic makefile, all source files will be recompiled if any of the source or header-files changes. Thus, the user may wish to appropriately modify the generic makefile before using it for large applications that will change frequently.


next up previous contents
Next: Using ordinary UNIX command Up: Building applications ported to Previous: Building applications ported to

Vijay Sadananda Pai
Thu Aug 7 14:18:56 CDT 1997