# @(#) makefile 1.5@(#) 94/07/18 #
# Makefile for ExFilter 1.1.x

SHELL=/bin/sh

.KEEP_STATE:

#--------------------------------------------------------------------------
# Compute architecture types we can generate.

# ARCH is the applications architecture.
# KARCH is the kernel architecture.
# OSTYPE is the OS name, eg SunOS.
# OSMREV is the major revision level of the OS, eg 4 for SunOS 4.1.x,
#     5 for SunOS 5.x.
ARCH:sh=/bin/arch
KARCH:sh=/bin/arch -k
OSTYPE:sh=/bin/uname -s
OSMREV:sh=case `/bin/uname -s` in \
    SunOS) \
        case `/bin/uname -r` in 4.1*) echo 4;; 5*) echo 5;; *) exit 1;; esac;;\
    *) \
        exit 1;; \
    esac

# APPSARCH is the fully-qualified architechture (FQA) for non-kernel parts.
# KAPPSARCH is the FQA for kernel-dependent parts.
APPSARCH=$(ARCH)-$(OSTYPE)-$(OSMREV)
KAPPSARCH=$(ARCH)-$(KARCH)-$(OSTYPE)-$(OSMREV)

# GCC is localtion of gcc driver.
GCC=/usr/local/bin/gcc/bin/gcc

#--------------------------------------------------------------------------
# Compute target names and set default (`all') target.

ALLTARGETS= \
	1.1.2/ExFilter.O.$(APPSARCH) \
	1.1.1/ExFilter.O.$(APPSARCH)

all: $(ALLTARGETS)
	@(echo Made:; echo '    '`echo $(ALLTARGETS)`.) | fmt -c

#--------------------------------------------------------------------------
# Cleaning up, making distributions, etc.

clean: FORCE
	rm -f obj/*.o $(ALLTARGETS)

FORCE:

#--------------------------------------------------------------------------
# Rules for making individual versions.

1.1.1/%: FORCE
	cd 1.1.1 && $(MAKE) $(@:1.1.1/%=%)

1.1.2/%: FORCE
	cd 1.1.2 && $(MAKE) $(@:1.1.2/%=%)
