------------------------------------------------------------------------------- Common Imake Rules Standard settings INCLUDES = -I$(TOP) -I$(TOP)/X11 DEPLIBS = XawClientDepLibs LOCAL_LIBRARIES = XawClientLibs CDEBUGFLAGS = -g SYS_LIBRARIES = -lcurses SRCS = main.c part1.c part2.c OBJS = main.o part1.o part2.o Alternitively DEPLIBS = $(DEPXONLYLIB) LOCAL_LIBRARIES = $(XONLYLIB) Make one complex program OBJS = file1.o file2.o LOCAL_LIBRARIES = XawClientLibs DEFINES = -Ddefine ComplexProgramTarget(complexprogram) build prog from OBJS Make one program NormalProgramTarget(program,objects,deplibs,locallibs,syslibs) InstallProgram(program,$(BINDIR)) InstallManPage(program,$(MANDIR)) Make multiple programs all :: complexprogram program Subdirectories CC=fake_acc #define PassCDebugFlags 'CC=$(CC)' #define IHaveSubdirs #define Subdirs lib src MakeSubdirs(Subdirs) DependSubdirs(Subdirs) Installation of files InstallScript(prog,$(BINDIR)) install shell script InstallProgram(prog,$(BINDIR)) install binary program InstallAppDefaults(Prog) install Prog.ad into lib area InstallNonExecFile($(PROGNAME).rc,$(LIBDIR)) install non-executable bitmaps -> $(INCDIR)/bitmaps ------------------------------------------------------------------------------- Motif Library under solaris # LOCAL_LIBRARIES= XmClientLibs # Does not work LOCAL_LIBRARIES= -lXm XawClientLibs INCLUDES=-I/usr/dt/include ------------------------------------------------------------------------------- Alternative Destination Imakefile Defines BINDIR = $(HOME)/games LIBDIR = $(HOME)/games/lib MANDIR = $(HOME)/man MANSUFFIX = 1 XAPPLOADDIR = $(HOME)/.xapp-defaults MKDIRHIER = mkdirhier CONFIGDIR = /usr/lib/X11/config ------------------------------------------------------------------------------- Manpages as per Solaris (site.def file) /* Put manpages in 1x on sunos4 (as it does on solaris) */ #define ManSuffix 1x #define ManDir $(MANSOURCEPATH)1 #define LibManSuffix 3x #define LibmanDir $(MANSOURCEPATH)3 ------------------------------------------------------------------------------- Shared and Normal librarys (R5 or greater) Xpm -- the library name $(SOXPMLIBREV) -- version or revision $(OBJS) -- the object file in the library LibraryObjectRule() #if DoSharedLib #if DoNormalLib SharedLibraryTarget(Xpm,$(SOXPMLIBREV),$(OBJS),shared,..) #else SharedLibraryTarget(Xpm,$(SOXPMLIBREV),$(OBJS),.,.) #endif InstallSharedLibrary(Xpm,$(SOXPMLIBREV),$(USRLIBDIR)) #endif #if DoNormalLib NormalLibraryTarget(Xpm,$(OBJS)) InstallLibrary(Xpm,$(USRLIBDIR)) #endif InstallMultiple($(HEADERS),$(INCDIR)) /**/# Lint library LintLibraryTarget(Xpm,$(SRCS)) InstallLintLibrary(Xpm,$(LINTLIBDIR)) DependTarget() NormalLintTarget($(SRCS)) -------------------------------------------------------------------------------