1 # Makefile for cln/examples
2 # This is only needed while CLN has not been installed in a public place on
3 # your system (such as /usr/local/include and /usr/local/lib). Once CLN is
4 # installed, a simple C++ compiler command suffices.
6 #### Start of system configuration section. ####
8 # Directories used by "make":
10 top_srcdir = @top_srcdir@
12 # Programs used by "make":
22 INCLUDES = -I../include -I${top_srcdir}/include -I${srcdir}
23 override CPPFLAGS += ${INCLUDES}
25 LIBTOOL_LINK = ${LIBTOOL} --mode=link
32 #### End of system configuration section. ####
36 # Needed by ${LIBTOOL}.
41 FILES_CC := $(notdir $(wildcard ${srcdir}/*.cc))
42 FILES_CC := $(filter-out %.i.cc, ${FILES_CC})
44 FILES_I_CC := $(patsubst %.cc,%.i.cc,${FILES_CC})
46 FILES_S := $(patsubst %.cc,%.s,${FILES_CC})
48 FILES_O := $(patsubst %.cc,%.o,${FILES_CC})
52 LIBS = ../src/libcln.la -lm
53 LIBDEPS = ../src/libcln.la
55 PROGRAMS = $(addsuffix ${EXEEXT},contfrac e fibonacci legendre lucaslehmer nextprime perfnum pi)
56 MODULES_contfrac = contfrac
58 MODULES_fibonacci = fibonacci
59 MODULES_legendre = legendre
60 MODULES_lucaslehmer = lucaslehmer
61 MODULES_nextprime = nextprime
62 MODULES_perfnum = perfnum
65 all : $(addsuffix ${EXEEXT}, contfrac e fibonacci legendre lucaslehmer nextprime perfnum pi)
68 ${CC} ${CFLAGS} ${CPPFLAGS} ${TARGET_ARCH} -S $< -o $@
71 ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${TARGET_ARCH} -S $< -o $@
74 ${CC} ${CFLAGS} ${CPPFLAGS} ${TARGET_ARCH} -c $< -o $@
77 ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${TARGET_ARCH} -c $< -o $@
80 ${CPP} ${CFLAGS} ${CPPFLAGS} ${TARGET_ARCH} $< > $@
83 ${CXXCPP} ${CXXFLAGS} ${CPPFLAGS} ${TARGET_ARCH} $< > $@
85 contfrac${EXEEXT} : $(patsubst %,%.o,${MODULES_contfrac})
86 e${EXEEXT} : $(patsubst %,%.o,${MODULES_e})
87 fibonacci${EXEEXT} : $(patsubst %,%.o,${MODULES_fibonacci})
88 legendre${EXEEXT} : $(patsubst %,%.o,${MODULES_legendre})
89 lucaslehmer${EXEEXT} : $(patsubst %,%.o,${MODULES_lucaslehmer})
90 nextprime${EXEEXT} : $(patsubst %,%.o,${MODULES_nextprime})
91 perfnum${EXEEXT} : $(patsubst %,%.o,${MODULES_perfnum})
92 pi${EXEEXT} : $(patsubst %,%.o,${MODULES_pi})
93 ${PROGRAMS} : %${EXEEXT} : ${LIBDEPS}
94 ${LIBTOOL_LINK} ${CXX} ${CXXFLAGS} ${TARGET_ARCH} $(patsubst %,%.o,$(MODULES_$(*F))) ${LDFLAGS} ${LIBS} -o $@
108 ${RM} *.s *.o *.a ${PROGRAMS} a.out core
112 ${RM} config.status config.log config.cache Makefile
114 maintainer-clean : distclean