# This makefile is a generic makefile for building a generic inspector control
# library. You should call it by specifying on the smake command line the
# LIBNAME=<libname> macro definition, e.g.:
# 	"smake -f makefile.generic LIBNAME=asl"
# The makefile uses a fixed revision and .fd specification.


i$(LIBNAME).library: i$(LIBNAME).o inspectorlibinit.o

	# slink can generate thousands of warnings during a link like this one.
	# >NIL: saves you part of the nuisance. You should NOT try to add
	# SmallData here, because it does not work with libraries.

	slink >NIL: LIBPREFIX _LIB LIBFD igeneric_lib.fd to i$(LIBNAME).library\
	FROM lib:libent.o inspectorlibinit.o i$(LIBNAME).o i$(LIBNAME)_stubs.o\
	lib lib:amiga.lib lib:scnb.lib \
	noicons \
	LibVersion 37 \
	LibRevision 1 \
	LibID "i$(LIBNAME) 37.1 (13.11.93)"
	-copy i$(LIBNAME).library libs:inspectors/

i$(LIBNAME).o: i$(LIBNAME).c

	# We cannot use strmerge because usually the code section
	# is too big, and the compiler complains heavily.

	sc optimize streq libcode nostackcheck data=faronly $*
	asm -u i$(LIBNAME)_stubs

inspectorlibinit.o: inspectorlibinit.c
	sc optimize streq libcode nostackcheck data=faronly strmerge $*

# No dependency is specified for the generation of the C code. You may want
# to add a dependency to an .fd file, or just to recompile this target with -u
# when needed.

i$(LIBNAME).c:
	makelib $(LIBNAME)
