# Defaults to Alpha architecture. Use "VAX=1" for a VAX build, "IA64=1" for an # Itanium build. ifndef VAX ifndef IA64 ALPHA = 1 endif endif OBJ_SUFFIX = obj OLB_SUFFIX = olb SHR_SUFFIX = exe OBJLIB = $(IMAGE_NAME).$(OLB_SUFFIX) EMPTY := SPACE := $(EMPTY) $(EMPTY) COMMA := , ECHO := write sys$$output CP := copy /log NL := nl: DEFINES = HAVE_STDLIB_H=1 # Alpha only compiler flags. ifdef ALPHA CFLAGS += /pointer_size=short PTRSIZ = 32 DEST = [.Alpha] endif # Itanium only compiler flags. ifdef IA64 CFLAGS += /pointer_size=short PTRSIZ = 32 DEST = [.ia64] endif # VAX only compiler flags. ifdef VAX CFLAGS = PTRSIZ = DEST = [.VAX] endif IMAGE_NAME = sserver # Compiler flags we always want CFLAGS += /obj=$@/prefix=all /include=([],[-],krb$$root:[include]) LFLAGS = /exe=$@ ifdef DEBUG CFLAGS += /debug/nooptimize/lis/show=all DEFINES += ,"DEBUG=1" LFLAGS += /debug/map=$(DEST)/full else LFLAGS += /nodebug ### /notraceback endif CFLAGS += /define=($(DEFINES)) CSRCS = SSERVER.C BASE_H_FILES = [-]SAMPLE.H #Rules OBJS = $(CSRCS:.c=.$(OBJ_SUFFIX)) TARGETS = $(DEST)sserver.exe all: $(TARGETS) $(DEST)sserver.exe: $(DEST)sserver.obj link $(LFLAGS) $(DEST)sserver.obj,[]krblnk$(PTRSIZ).opt/option $(DEST)sserver.obj: sserver.c cc $(CFLAGS) $? $(DEST)$(OBJLIB): $(OBJS) @if f$$search("$@") .eqs. "" then library /create $@ library /replace /log $@ $? clean: @if f$$search("$(DEST)*.$(OBJ_SUFFIX)") .nes. "" then delete /log $(DEST)*.$(OBJ_SUFFIX);* @if f$$search("$(DEST)*.$(SHR_SUFFIX)") .nes. "" then delete /log $(DEST)*.$(SHR_SUFFIX);* @if f$$search("$(DEST)*.lis") .nes. "" then delete /log $(DEST)*.lis;* @if f$$search("$(DEST)*.map") .nes. "" then delete /log $(DEST)*.map;* @if f$$search("$(DEST)$(OBJLIB)") .nes. "" then delete /log $(DEST)$(OBJLIB);* help: @$(ECHO) " gmake -? - Displays general Gmake command line help" @$(ECHO) " gmake help - Displays help for using/typing gmake in this directory" @$(ECHO) "" @$(ECHO) " gmake - Builds the Alpha MIT sserver" @$(ECHO) " gmake ""DEBUG=1"" - Builds everything with DEBUG" @$(ECHO) "" @$(ECHO) " gmake ""VAX=1"" - Builds the VAX MIT sserver" @$(ECHO) " gmake ""VAX=1"" ""DEBUG=1"" - Builds the VAX MIT sserver with DEBUG" @$(ECHO) "" @$(ECHO) " gmake ""IA64=1"" - Builds the Itanium MIT sserver" @$(ECHO) " gmake ""IA64=1"" ""DEBUG=1"" - Builds the Itanium MIT sserver with DEBUG" @$(ECHO) "" @$(ECHO) " gmake clean - Cleans this current directory"