1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
#-------------------------------------------------------------------------------
# CAMD Makefile for compiling on Unix systems (for GNU make only)
#-------------------------------------------------------------------------------
SOVERSION = $(shell perl ../../debian/library-soname.pl CAMD | sed 's/libcamd//')
default: libcamd.a libcamd.so.$(SOVERSION)
include ../../SuiteSparse_config/SuiteSparse_config.mk
C = $(CC) $(CF) -I../Include -I../../SuiteSparse_config
#-------------------------------------------------------------------------------
# source files
#-------------------------------------------------------------------------------
CAMD = camd_aat camd_1 camd_2 camd_dump camd_postorder camd_defaults \
camd_order camd_control camd_info camd_valid camd_preprocess
INC = ../Include/camd.h ../Include/camd_internal.h \
../../SuiteSparse_config/SuiteSparse_config.h
#-------------------------------------------------------------------------------
# object files for each version
#-------------------------------------------------------------------------------
CAMDI = $(addsuffix .o, $(subst camd_,camd_i_,$(CAMD)))
CAMDL = $(addsuffix .o, $(subst camd_,camd_l_,$(CAMD)))
CAMDI_SL = $(addsuffix .oo, $(subst camd_,camd_i_,$(CAMD)))
CAMDL_SL = $(addsuffix .oo, $(subst camd_,camd_l_,$(CAMD)))
#-------------------------------------------------------------------------------
# compile each int and long routine (with no real/complex version)
#-------------------------------------------------------------------------------
camd_global.o: ../Source/camd_global.c $(INC)
$(C) -c $< -o $@
camd_global.oo: ../Source/camd_global.c $(INC)
$(C) -fPIC -c $< -o $@
camd_i_%.o: ../Source/camd_%.c $(INC)
$(C) -DDINT -c $< -o $@
camd_i_%.oo: ../Source/camd_%.c $(INC)
$(C) -fPIC -DDINT -c $< -o $@
camd_l_%.o: ../Source/camd_%.c $(INC)
$(C) -DDLONG -c $< -o $@
camd_l_%.oo: ../Source/camd_%.c $(INC)
$(C) -fPIC -DDLONG -c $< -o $@
#-------------------------------------------------------------------------------
# Create the libcamd.a library (C versions only)
#-------------------------------------------------------------------------------
libcamd.a: camd_global.o $(CAMDI) $(CAMDL)
$(ARCHIVE) libcamd.a $^
- $(RANLIB) libcamd.a
libcamd.so.$(SOVERSION): camd_global.oo $(CAMDI_SL) $(CAMDL_SL)
$(CC) $(LDFLAGS) -shared $^ -lm -Wl,-soname -Wl,$@ -o $@
ln -s $@ libcamd.so
#-------------------------------------------------------------------------------
# Remove all but the files in the original distribution
#-------------------------------------------------------------------------------
clean:
- $(RM) $(CLEAN)
-$(RM) *.oo
-$(RM) *.a
-$(RM) *.so*
purge: distclean
distclean: clean
- $(RM) libcamd.a
|