# ----------------------------------------------------------------------------
# - Makefile                                                                 -
# - aleph system library makefile                                            -
# ----------------------------------------------------------------------------
# - This program is  free software;  you can  redistribute it and/or  modify -
# - it provided that this copyright notice is kept intact.                   -
# -                                                                          -
# - 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. In not event shall -
# - the copyright holder be  liable for  any direct, indirect, incidental or -
# - special damages arising in any way out of the use of this software.      -
# ----------------------------------------------------------------------------
# - copyright (c) 1999-2000 amaury darsch                                    -
# ----------------------------------------------------------------------------

TOPDIR		= ../../..
CNFDIR		= $(TOPDIR)/cnf
SITEFILE	= $(CNFDIR)/site.mak
RULEFILE	= $(CNFDIR)/rule.mak
include		  $(SITEFILE)

# ----------------------------------------------------------------------------
# source file generation                                                     -
# ----------------------------------------------------------------------------

ARLIB		= libastc.a
SOLIB		= $(ARLIB:.a=.so)
TARGET		= $(ARLIB) $(SOLIB)
INCLUDE		= -I. -I$(AENGINC) -I$(ASTDINC) -I$(ASYSINC)

CPPSRCS		= Libasys.cpp  \
		  Syscalls.cpp

# ----------------------------------------------------------------------------
# - project rules                                                            -
# ----------------------------------------------------------------------------

# rule: all
# this rule is the default rule which call the build rule

all: build
.PHONY: all

# include: rule.mak
# this rule includes the platform dependant rules

include $(RULEFILE)

# rule: build
# build the standard object library (libastd)

build: $(TARGET)
.PHONY: build

# rule: libasys.a
# build the library archive

$(ARLIB): $(OBJECTS)
	$(AR) $@ $(OBJECTS)
	@$(MKDIR) $(LIBREL)
	@$(CP) $@ $(LIBREL)

# rule: libasys.so
# build the library archive

$(SOLIB).$(SOFILE): $(OBJECTS)
	$(LD) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBAENG)
	@$(MKDIR) $(LIBREL)
	@$(CP) $@ $(LIBREL)

# rule: install
# install the libraries

install: installlib
.PHONY: install
