#
#   $Id: Makefile,v 1.4 1999/01/19 18:21:45 peter Exp $
#   Copyright (c) 1998 by the Free Pascal Development Team
#
#   Makefile for Lowlevel API for Free Pascal
#
#   See the file COPYING.FPC, included in this distribution,
#   for details about the copyright.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#


#####################################################################
# Defaults
#####################################################################

# Where are the files located
OSINC=$(OS_TARGET)

# Add this dir also to the path as first
NEEDUNITDIR=$(OS_TARGET)

# Where need we to place the executables/ppu/objects
TARGETDIR=.

# As default make only the units
DEFAULTUNITS=1


#####################################################################
# Real targets
#####################################################################

# Override defaults
override LIBNAME=api
override PASEXT=.pas

vpath %$(PASEXT) $(OSINC) test

include test/makefile.api

UNITOBJECTS=common callspec video keyboard mouse filectrl filesys 
EXEOBJECTS=$(TESTOBJECTS)


#####################################################################
# Include default makefile
#####################################################################

ifndef FPCMAKE
ifdef FPCDIR
FPCMAKE=$(FPCDIR)/makefile.fpc
else
FPCMAKE=makefile.fpc
endif
endif

override FPCMAKE:=$(strip $(wildcard $(FPCMAKE)))
ifeq ($(FPCMAKE),)
nofpcmake:
	@echo
	@echo makefile.fpc not found!
	@echo Check the FPCMAKE and FPCDIR environment variables.
	@echo
	@exit
else
include $(FPCMAKE)
endif


#####################################################################
# Dependencies
#####################################################################

video$(PPUEXT): video.pas $(OSINC)/video.inc

keyboard$(PPUEXT): keyboard.pas $(OSINC)/keyboard.inc

mouse$(PPUEXT): mouse.pas $(OSINC)/mouse.inc

filectrl$(PPUEXT): filectrl.pas $(OSINC)/filectrl.inc

# Allow test as target which compiles the exes
test: exes

#
# $Log: Makefile,v $
# Revision 1.4  1999/01/19 18:21:45  peter
#   * Use FPCDIR and FPCMAKE environment to find makefile.fpc
#   * better install dir setting
#
#
