#-------------------------------------------------------
#
#	Generic Crossplatform Makefile
#
#	Author:	stephen beaulieu <hippo@be.com>
#
#	Questions, comments & concerns to <devsupport@be.com>
#
#	Copyright 1998 Be, Inc.  All Rights Reserved
#
#	Fill out the Project Specific Information section
#	Use a \ to continue information on different lines
#	example: SRCS = source1.cpp \
#					source2.cpp
#
#	When done simply cd to the directory in the terminal
#	and type make.  The objects and binary will appear
#	in an obj.x86 or obj.PPC folder.
#
#--------------------------------------------------------

#--------------------------------------------------------
#	High-level Project Information
#--------------------------------------------------------

#	specify the name of the project
	IMG_NAME	= ArpTelnet
	
#	specify the type of image to create
	IMG_TYPE	= APP

#	specify version of project
	VERSION		= 1.3.1
	
# first include the common rules for setting up all
# platform-specific information

include ../makefiles/platform

#--------------------------------------------------------
#	Project Specific Information
#--------------------------------------------------------

#	specify the list of source files
	SRCS		= $(shell ls 2>/dev/null -1 *.cpp)
	HEADERS		= $(shell ls 2>/dev/null -1 *.h)
	
	CFLAGS		= -str pool -ansi strict -bool on -requireprotos

ifeq ($(CPU), PPC)
	CFLAGS		+= -str ro -toc_data on 
endif

ifeq ($(CPU), PPC)
	LDFLAGS		= -dead on
endif

#	specify the list of resource files
	RSRCS		= ArpTelnet
	
#	specify how to create distribution
	DIST_MAKES	= ../ArpTermEmu/Makefile
	DIST_SRCDIR	= ArpTelnet
	DIST_FILES	= README
	DIST_SRCS	= $(HEADERS) $(SRCS) $(DIST_FILES) \
					$(shell ls 2>/dev/null -1 *.rsrc) Makefile MakeApp
	
#	specify any additional beos shared libraries needed.
	ADD_BESHLIBS	= libnet.so

#	specify additional non-beos shared libraries needed.
	ADD_SHLIBS		= 

#	specify any additional beos static libraries needed.
	ADD_BESTLIBS	= $(CPPLIB)

#	specify additional non-beos static libraries needed.
	ADD_STLIBS		= ../ArpCommon/$(OBJ_DIR)/libArpCommon.a

#	specify any additional system include paths.
	SYSTEM_INCLUDES	=
	SYSLOCAL_INCLUDES	= ../

#	specify any additional local include paths.
	LOCAL_INCLUDES	=

#--------------------------------------------------------
#	Build Rules
#--------------------------------------------------------

# Special rules for copying application into public directory

	DEST_DIR	= ./
	PUBLIC_TARGET	= $(DEST_DIR)$(TARGET_NAME)

# define the actual work to be done	

default: $(PUBLIC_TARGET)
	rm -rf add-ons
	ln -s ../ArpTermEmu/add-ons add-ons

$(PUBLIC_TARGET): $(TARGET)
	mkdir --parents $(shell dirname $@)
	$(COPY) $< $@
	[ -e $<.xSYM ] || $(COPY) $<.xSYM $@.xSYM > /dev/null 2>&1
	-$(COPY) $<.xMAP $@.xMAP

clean:: clean_project
	rm -f $(PUBLIC_TARGET) $(PUBLIC_TARGET).xSYM $(PUBLIC_TARGET).xMAP $(PUBLIC_TARGET).dbg

dist:: dist_project
	mkdir --parents $(DIST_TARGET)/add-ons/ArpTerminal
	for i in add-ons/ArpTerminal/*.so; do \
		$(COPY) $$i $(DIST_TARGET)/$$i; \
	done

# include common build rules for above definitions

include ../makefiles/project

depends: $(DEPENDENCIES)
	@echo >/dev/null
