#===========================================================================
#
# src/apps Makefile
#
#===========================================================================
#
# Delete implicit rules 
.SUFFIXES:

ifndef TOPDIR
        TOPDIR:=$(shell pwd | sed -e 's?/src.*??')
endif

MAKE+= -I $(TOPDIR)/src --no-print-directory --no-builtin-rules
#
# Determine the operating system
#
OSNAME:=$(shell uname)

ifeq ($(OSNAME),SunOS)
# Set the definitions for Sun Solaris
  ITS_BIG_ENDIAN := 1
  ITS_SPARC_SOLARIS := 1
  export ITS_SPARC_SOLARIS 
endif

ifeq ($(OSNAME),Linux)
# Set the definitions for Linux
  ITS_LINUX := 1
  export ITS_LINUX
endif

ifeq ($(OSNAME),Darwin)
# Set the definitions for Mac OSX
  ITS_PPC_OSX := 1
  export ITS_PPC_OSX
endif

# Include the individual application makefiles
#
target_files := $(wildcard *.make)
targets := $(basename $(target_files))

all : $(targets)

$(targets) : FORCE
	@$(MAKE) -f $@.make

FORCE:

%.clean : %.make
	@$(MAKE) -f $< clean

vpath %.include $(TOPDIR)/src

include $(TOPDIR)/src/Makeshare.include
