203 lines
5.1 KiB
Makefile
203 lines
5.1 KiB
Makefile
# SkipList
|
|
|
|
srcdir= @srcdir@/../src
|
|
tstdir= @srcdir@/../test
|
|
distdir= @srcdir@/../dist
|
|
builddir=.
|
|
|
|
##################################################
|
|
# Installation directories and permissions.
|
|
##################################################
|
|
prefix= @prefix@
|
|
exec_prefix= @exec_prefix@
|
|
bindir= @bindir@
|
|
includedir= @includedir@
|
|
libdir= @libdir@
|
|
docdir= $(prefix)/docs
|
|
|
|
dmode= 755
|
|
emode= 555
|
|
fmode= 444
|
|
|
|
transform=@program_transform_name@
|
|
|
|
##################################################
|
|
# Paths for standard user-level commands.
|
|
##################################################
|
|
SHELL= @db_cv_path_sh@
|
|
ar= @db_cv_path_ar@
|
|
awk= @db_cv_path_awk@
|
|
chmod= @db_cv_path_chmod@
|
|
cp= @db_cv_path_cp@
|
|
depend= @db_cv_path_makedepend@
|
|
grep= @db_cv_path_grep@
|
|
ln= @db_cv_path_ln@
|
|
mkdir= @db_cv_path_mkdir@
|
|
ranlib= @db_cv_path_ranlib@
|
|
rm= @db_cv_path_rm@
|
|
rpm= @db_cv_path_rpm@
|
|
sed= @db_cv_path_sed@
|
|
perl= @db_cv_path_perl@
|
|
splint= @db_cv_path_splint@
|
|
strip= @db_cv_path_strip@
|
|
|
|
##################################################
|
|
# General library information.
|
|
##################################################
|
|
DEF_LIB= @DEFAULT_LIB@
|
|
INSTALLER= @INSTALLER@
|
|
LIBTOOL= @LIBTOOL@
|
|
POSTLINK= @POSTLINK@
|
|
SOLINK= @MAKEFILE_SOLINK@
|
|
SOFLAGS= @SOFLAGS@
|
|
LIBMAJOR= @SKIPLIST_VERSION_MAJOR@
|
|
LIBVERSION= @SKIPLIST_VERSION_MAJOR@.@SKIPLIST_VERSION_MINOR@
|
|
CPPFLAGS= -I$(builddir) -I$(srcdir) @CPPFLAGS@
|
|
|
|
##################################################
|
|
# C
|
|
##################################################
|
|
CFLAGS= -c $(CPPFLAGS) @CFLAGS@
|
|
CC= @MAKEFILE_CC@
|
|
CCLINK= @MAKEFILE_CCLINK@
|
|
|
|
LDFLAGS= @LDFLAGS@
|
|
LIBS= @LIBS@
|
|
LIBSO_LIBS= @LIBSO_LIBS@
|
|
|
|
libskiplist_base= libskiplist
|
|
libskiplist= $(libskiplist_base).a
|
|
libskiplist_version= $(libskiplist_base)-$(LIBVERSION).a
|
|
libso= $(libskiplist_base)-$(LIBVERSION)@SOSUFFIX@
|
|
libso_target= $(libskiplist_base)-$(LIBVERSION).la
|
|
libso_default= $(libskiplist_base)@SOSUFFIX@
|
|
libso_major= $(libskiplist_base)-$(LIBMAJOR)@SOSUFFIX@
|
|
|
|
##################################################
|
|
# Source file lists.
|
|
##################################################
|
|
|
|
C_FILES=\
|
|
$(srcdir)/skiplist.c
|
|
|
|
##################################################
|
|
# Object and utility lists.
|
|
##################################################
|
|
|
|
C_OBJS=\
|
|
skiplist@o@
|
|
|
|
##################################################
|
|
# List of files installed into the library directory.
|
|
##################################################
|
|
LIB_INSTALL_FILE_LIST=\
|
|
$(libdbsql) \
|
|
$(libso) \
|
|
$(libso_default) \
|
|
$(libso_major) \
|
|
$(libdbsql_version) \
|
|
$(libso_target) \
|
|
$(libtso) \
|
|
$(libtso_default) \
|
|
$(libtso_major) \
|
|
$(libtso_static) \
|
|
$(libtso_target)
|
|
|
|
##################################################
|
|
# We're building a standard library or a RPM file hierarchy.
|
|
# Note: "all" must be the first target in the Makefile.
|
|
##################################################
|
|
all: @BUILD_TARGET@
|
|
|
|
install-strip install: all @INSTALL_TARGET@
|
|
|
|
##################################################
|
|
# Library build.
|
|
##################################################
|
|
library_build: $(libso_target) $(libtso_target)
|
|
|
|
# Static C library named libskiplist.a.
|
|
$(libskiplist): $(DEF_LIB)
|
|
$(rm) -f $@
|
|
test ! -f .libs/$(libskiplist_version) || \
|
|
$(ln) -s .libs/$(libskiplist_version) $@
|
|
test -f .libs/$(libskiplist_version) || \
|
|
(test -f $(libskiplist_version) &&
|
|
$(ln) -s $(libskiplist_version) $@)
|
|
|
|
# Real static C library.
|
|
$(libskiplist_version): skiplist.h $(C_OBJS)
|
|
$(ar) cr $@ $(C_OBJS)
|
|
test ! -f $(ranlib) || $(ranlib) $@
|
|
|
|
# Shared C library.
|
|
$(libso_target): skiplist.h $(C_OBJS)
|
|
$(SOLINK) $(SOFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) $(LIBSO_LIBS)
|
|
|
|
##################################################
|
|
# Testing.
|
|
##################################################
|
|
test: test@o@ munit@o@
|
|
$(CCLINK) -o $@ $(LDFLAGS) \
|
|
test@o@ $(DEF_LIB) $(LIBS)
|
|
$(POSTLINK) $@
|
|
|
|
check: test
|
|
./test
|
|
|
|
##################################################
|
|
# Remaining standard Makefile targets.
|
|
##################################################
|
|
|
|
CLEAN_LIST=\
|
|
$(builddir)/example \
|
|
$(tstdir)/test $(tstdir)/*.o
|
|
|
|
mostly-clean clean:
|
|
$(rm) -rf $(C_OBJS)
|
|
$(rm) -rf *.exe $(CLEAN_LIST)
|
|
$(rm) -rf tags *@o@ *~ *.o *.o.lock *.lo core *.core *.loT
|
|
$(rm) -rf .libs $(LIB_INSTALL_FILE_LIST)
|
|
|
|
REALCLEAN_LIST=\
|
|
Makefile config.cache config.log config.status \
|
|
configure.lineno skiplist.h
|
|
|
|
distclean maintainer-clean realclean: clean
|
|
$(rm) -rf $(REALCLEAN_LIST)
|
|
$(rm) -rf libtool
|
|
|
|
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
|
libtool: $(LIBTOOL_DEPS)
|
|
$(SHELL) ./deps/config.status $(builddir)/libtool
|
|
|
|
check dvi info obj TAGS:
|
|
@echo "$@: make target not supported" && true
|
|
|
|
dist:
|
|
@echo "$@: make target not supported" && false
|
|
|
|
##################################################
|
|
# Example programs for C.
|
|
##################################################
|
|
|
|
example: $(DEF_LIB) example@o@
|
|
$(CCLINK) -o $@ $(LDFLAGS) \
|
|
example@o@ $(DEF_LIB) $(LIBS)
|
|
$(POSTLINK) $@
|
|
|
|
##################################################
|
|
# C
|
|
##################################################
|
|
|
|
example@o@: $(srcdir)/example.c
|
|
$(CC) $(CFLAGS) $?
|
|
|
|
skiplist@o@: $(srcdir)/skiplist.c
|
|
$(CC) $(CFLAGS) $?
|
|
|
|
munit@o@: $(tstdir)/munit.c
|
|
$(CC) $(CFLAGS) $?
|
|
|
|
test@o@: $(tstdir)/test.c
|
|
$(CC) $(CFLAGS) $?
|