################################################################################
#
#  Makefile for APipe-Handler (standalone version)
#
#  Copyright (C) 1991 by Per Bojsen.  All Rights Reserved.
#
#  $Id$
#
#  $Log$

# The architecture flags allow you to specify optimizations for the processor
# type you want.  Uncomment the one you have, or leave all commented if you
# want a generic sed that can run on any processor.
#
# NOTE: Make sure TARGET_ARCH and ARCH_OPTIMIZE is in sync!
#
# Target architecture
#TARGET_ARCH = -dMC68000
#TARGET_ARCH = -dMC68010
#TARGET_ARCH = -dMC68020
#TARGET_ARCH = -dMC68030
#TARGET_ARCH = -dMC68040
#
# Architecture flags
#ARCH_OPTIMIZE = -m0
#ARCH_OPTIMIZE = -m1
#ARCH_OPTIMIZE = -m2
#ARCH_OPTIMIZE = -m3
#ARCH_OPTIMIZE = -m4
#
# Floating point architecture
#MATH_ARCH = -dMC68881
#
# Floating point flags
#MATH_OPTIMIZE = -f8
#
# Floating point library
#MATH_LIB = LIB:lcm881.lib
#
# Combined machine architecture flags
MACH = $(TARGET_ARCH) $(MATH_ARCH) $(ARCH_OPTIMIZE) $(MATH_OPTIMIZE)

# Turn on optimizer
OPTIMIZE = -O

# Debugging
# DEBUGFLAGS = -d5

# Compiler driver
CC = lc

# C preprocessor
CPP = cpp -D__SASC

# Generic compiler flags
CFLAGS = -v -b0 $(DEFS) $(DEBUGFLAGS) $(MACH)

# Assembler
AS = asm

# Assembler flags
AFLAGS = -iASMINCLUDE:

# Librarian
AR = oml
ARCMDS = r

# Installation dir
INSTDIR = Work:usr/local/L

# Libraries
LIBS = LIB:amiga.lib LIB:lcnb.lib

OBJECTS = pgmpipe.o child.o

all: APipe-Handler

install:
	copy APipe-Handler $(INSTDIR)

clean:
	delete $(OBJECTS) APipe-Handler

APipe-Handler: $(OBJECTS)
	blink <WITH <(T:ppipe.link)
	FROM $(OBJECTS)
	LIB $(LIBS)
	TO $@
	ND SD SC VERBOSE
<

pgmpipe.o: pgmpipe.c

child.o: child.asm

# Default rules
.c.o:
	$(CC) $(CFLAGS) $(OPTIMIZE) -o$*.o $*

.asm.o:
	asm $(AFLAGS) -o$*.o $*.asm

.a.o:
	asm $(AFLAGS) -o$*.o $*.a
