#
# Application Makefile   
#

ifndef DEBUG
DEBUG = -g
endif

ifndef OPTIM
OPTIM = -O
endif

PLATFORM=wcc_qnx4
PHABOPTS= 

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) -w5 $(OPTIM) $(DEBUG) $(PHABOPTS) -I. -I $(PHLIB)/photon/public -I $(PHLIB)/exlib/public
CXXFLAGS = $(CFLAGS)
LDFLAGS = -V$(PLATFORM) -Bstatic $(DEBUG) -L $(LDLIBDIRS) -l Aplib -l phrtlib -l phexlib -l phcontrib -l photon -l phrender $(PHABOPTS)
SDFLAGS = -V$(PLATFORM)          $(DEBUG) -L $(LDLIBDIRS) -l Aplib -l phrtlib -l phexlib -l phcontrib -l photon -l phrender $(PHABOPTS)

VPATH = ..

include	../abOfiles
include ../indOfiles

include	../abSfiles
include ../indSfiles

include	../abHfiles
include ../indHfiles

include	../abWfiles

#
# Application Program
#

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

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

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

install:
		-cp -vnf pterm /usr/bin/photon

#
# Headers
#

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

#
# Prototype Generation
#

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