#
# Application Makefile   
#

ifndef DEBUG
DEBUG = -g
endif

ifndef OPTIM
OPTIM = -Osax
endif

PLATFORM=default
#

PHLIB=../../../../lib
LDLIBDIRS = $(PHLIB)/photon/qnx4/a:$(PHLIB)/Aplib/qnx4/a:$(PHLIB)/exlib/qnx4
SDLIBDIRS = $(PHLIB)/photon/qnx4/so:$(PHLIB)/Aplib/qnx4/so:$(PHLIB)/exlib/qnx4

CFLAGS  = -v$(PLATFORM) -3 -mf -w9 $(OPTIM) $(DEBUG) -I $(PHLIB)/photon/public -I $(PHLIB)/exlib/public
LDFLAGS = -v$(PLATFORM) -3 -M -mf $(DEBUG) -L $(LDLIBDIRS) -l Aplib   -l phexlib -l photon
SDFLAGS = -v$(PLATFORM) -3 -M -mf $(DEBUG) -L $(SDLIBDIRS) -l Aplib_s -l phexlib -l photon_s

VPATH = ..

include	../abOfiles
include ../indOfiles

include	../abSfiles
include ../indSfiles

include	../abHfiles
include ../indHfiles

include	../abWfiles

#
# Application Program
#

shr:	$(ABOBJ) $(MYOBJ)
		$(LD) $(SDFLAGS) $(ABOBJ) $(MYOBJ) -M \
		-o pterm
		usemsg pterm ../Usemsg
		phabbind pterm $(ABMOD)

app:	$(ABOBJ) $(MYOBJ)
		$(LD) $(LDFLAGS) $(ABOBJ) $(MYOBJ) -M \
		-o pterm
		usemsg pterm ../Usemsg
		phabbind pterm $(ABMOD)

clean:
		rm -f *.o *.err *.map pterm

DEST=/usr/photon/bin/pterm

install: shr
		beirut rm -f $(DEST)
		cp pterm.map pterm.map.`date +'%d%b%y'`
		beirut wstrip pterm $(DEST) pterm.sym.`date +'%d%b%y'` ||\
	        beirut cp -pv pterm $(DEST)

#
# Headers
#

$(ABOBJ) $(MYOBJ):	$(MYHDR)

#
# Prototype Generation
#

proto:
		approto -p $(ABSRC) $(MYSRC) > proto.h
