# here are the things you can change to tailor this package to your
# system requirements.

# the used compiler. You probably don't want to use AT&T cc...
CC = gcc

# the place where gcc can find the header files of this package. Thus
# this is the absolute path (please don't use relative paths, the path
# is accessed from Makefiles at different nesting levels of directories..)
# to get to the toplevel include directory. The value given here is
# right for my system, it probably is not for yours ;-))
# (Note: I keep a symlink from /usr/local/bsd43include to this place).
BSD_HEADERS = /usr/local/src/4.3bsd-net2-svr4/include

# This is a bit magic.. if you happen to have a gas installed in
# /usr/local/lib/gcc-as (thus the usual place gas likes to live), and this
# gas understands MIT assembly syntax and strips a leading underscore from
# symbol names, then use the first definition of ASOBJ_EXT. This is what
# I'm using to compile the hp300 BSD assembly files. If you don't
# have this gas installed (and I don't know yet if CBM is interested to
# distribute it on their system tape) use the second ASOBJ_EXT definition.
# In that case the Makefiles just use the precompiled object files.
ASOBJ_EXT = o
#ASOBJ_EXT = o.orig

# end of configuration part. You shouldn't need to change anything
# below this point.
#########################################################################

SUBDIRS = db gen locale net nsl socket stdio stdlib string compat-43 amiga

SHELL = /bin/ksh

all: libbsd43.so

libbsd43.so: FORCE
	[ -d objs ] || mkdir objs;
	for i in $(SUBDIRS); do \
	  echo "make $$(pwd)/$$i"; \
	  (cd $$i; make CC=$(CC) BSD_HEADERS=$(BSD_HEADERS) ASOBJ_EXT=$(ASOBJ_EXT) ); \
	done
	ld -G -o libbsd43.so objs/*
	@echo "Now as root copy libbsd43.so into /usr/lib."

# does not walk the directory trees.. use this target
# if you just want to rebuild, and don't want to check
# whether some sub directory needs rebuilds
loadlib: FORCE
	ld -G -o libbsd43.so objs/*
	@echo "Now as root copy libbsd43.so into /usr/lib."

FORCE:
