3 #### Start of system configuration section. ####
5 # Directories used by "make":
7 top_srcdir = @top_srcdir@
9 # Directories used by "make install":
11 local_prefix = /usr/local
12 exec_prefix = @exec_prefix@
13 datarootdir = @datarootdir@
16 includedir = @includedir@
20 # Programs used by "make":
30 INCLUDES = -I../include -I${top_srcdir}/include
31 override CPPFLAGS += ${INCLUDES}
35 LIBTOOL_COMPILE = ${LIBTOOL} --mode=compile
36 LIBTOOL_LINK = ${LIBTOOL} --mode=link
37 LIBTOOL_INSTALL = ${LIBTOOL} --mode=install
38 LIBTOOL_UNINSTALL = ${LIBTOOL} --mode=uninstall
47 # Libtool's library interface versions:
48 CL_CURRENT = @CL_CURRENT@
49 CL_REVISION = @CL_REVISION@
52 # Programs used by "make install":
54 INSTALL_PROGRAM = @INSTALL_PROGRAM@
55 INSTALL_DATA = @INSTALL_DATA@
57 #### End of system configuration section. ####
61 # Needed by ${LIBTOOL}.
64 # When this Makefile is called with SUBDIR=some_subdirectory, it builds
65 # only the object files belonging to sources in that subdirectory. The
66 # final library is built only if SUBDIR=.
69 # Define the search path for sources.
70 # The variable ${aux_srcdir} is needed because new versions of aufoconf tend to
71 # remove ${srcdir}, ${srcdir} and so on...
73 VPATH = ${aux_srcdir}/${SUBDIR}
75 # Add subdirectory specific flags.
76 include ${srcdir}/${SUBDIR}/Makeflags
77 override CPPFLAGS += ${SUBDIR_INCLUDES}
79 # Need to know the system name.
80 SYSTEM := $(shell uname -s)
82 FILES_CC := $(notdir $(wildcard ${srcdir}/${SUBDIR}/*.cc))
83 FILES_CC := $(filter-out %.i.cc, ${FILES_CC})
84 ASMFILES_CC := $(patsubst cl_asm_@host_cpu@_%.cc,cl_asm_%.cc, $(filter cl_asm_@host_cpu@_%.cc, ${FILES_CC}))
85 FILES_CC := $(filter-out cl_asm_%.cc, ${FILES_CC})
87 FILES_I_CC := $(patsubst %.cc,%.i.cc,${FILES_CC})
89 FILES_S := $(patsubst %.cc,%.s,${FILES_CC})
91 FILES_LO := $(patsubst %.cc,%.lo,${FILES_CC})
93 ASMFILES_S := $(patsubst %.cc,%.s,${ASMFILES_CC})
95 ASMFILES_LO := $(patsubst %.cc,%.lo,${ASMFILES_CC})
97 OBJECTS_LO = ${FILES_LO} ${ASMFILES_LO}
99 SUBDIRS := $(patsubst ${srcdir}/%/.,%,$(wildcard ${srcdir}/${SUBDIR}/*/.))
100 # Avoid certain subdirectories:
101 # private/ and old/ don't contain valid sources,
102 # CVS/, RCS/ and SCCS/ are created when people put the sources under version control,
103 # ii_files/ is created during "make" by SGI C++.
104 SUBDIRS := $(filter-out old ./old private ./private CVS %/CVS RCS %/RCS SCCS %/SCCS ii_files ./ii_files,${SUBDIRS})
107 # Rule 'all' must be the first in the file.
111 # Recurse into subdirectories
113 SUBDIRS_DIRDEP := $(patsubst %,%.dirdep,${SUBDIRS})
115 ${SUBDIRS_DIRDEP} : %.dirdep :
118 # Target 'all' creates all necessary files for $(SUBDIR) and its subdirectories.
120 SUBDIRS_TARGET_ALL := $(patsubst %,%.target_all,${SUBDIRS})
122 ${SUBDIRS_TARGET_ALL} : %.target_all : %.dirdep
123 ${MAKE} SUBDIR=$* all
126 ALLFILES_CC := $(notdir $(wildcard ${srcdir}/*.cc) $(foreach subdir,${SUBDIRS}, $(wildcard ${srcdir}/${subdir}/*.cc) $(wildcard ${srcdir}/${subdir}/*/*.cc) $(wildcard ${srcdir}/${subdir}/*/*/*.cc)))
127 ALLFILES_CC := $(filter-out %.i.cc, ${ALLFILES_CC})
128 ALLASMFILES_CC := $(patsubst cl_asm_@host_cpu@_%.cc,cl_asm_%.cc, $(filter cl_asm_@host_cpu@_%.cc, ${ALLFILES_CC}))
129 ALLFILES_CC := $(filter-out cl_asm_%.cc, ${ALLFILES_CC})
130 ALLFILES_LO := $(patsubst %.cc,%.lo,${ALLFILES_CC})
131 ALLASMFILES_LO := $(patsubst %.cc,%.lo,${ALLASMFILES_CC})
132 ALLOBJECTS_LO = ${ALLFILES_LO} ${ALLASMFILES_LO}
134 _all_ : allo-local ${SUBDIRS_TARGET_ALL} libcln.la
136 _all_ : allo-local ${SUBDIRS_TARGET_ALL}
140 # Target 'alls' creates all .s files for $(SUBDIR) and its subdirectories.
142 SUBDIRS_TARGET_ALLS := $(patsubst %,%.target_alls,${SUBDIRS})
144 ${SUBDIRS_TARGET_ALLS} : %.target_alls : %.dirdep
145 ${MAKE} SUBDIR=$* alls
147 alls : alls-local ${SUBDIRS_TARGET_ALLS}
149 alls-local : ${FILES_S} ${ASMFILES_S}
152 # Target 'allo' creates all .lo files for $(SUBDIR) and its subdirectories.
153 SUBDIRS_TARGET_ALLO := $(patsubst %,%.target_allo,${SUBDIRS})
155 ${SUBDIRS_TARGET_ALLO} : %.target_allo : %.dirdep
156 ${MAKE} SUBDIR=$* allo
158 allo : allo-local ${SUBDIRS_TARGET_ALLO}
160 allo-local : ${FILES_LO} ${ASMFILES_LO}
163 ASMFLAGS := @ASMFLAGS@
164 ifeq (@AS_UNDERSCORE@,true)
165 ASMFLAGS += -DUNDERSCORE
168 # Rules for normal compilation.
171 ${LIBTOOL_COMPILE} ${CC} ${CFLAGS} ${CPPFLAGS} ${TARGET_ARCH} -c $<
174 ${LIBTOOL_COMPILE} ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${TARGET_ARCH} -c $<
176 # Rules for normal compilation, only needed for debugging.
179 ${CC} ${CFLAGS} ${CPPFLAGS} ${TARGET_ARCH} -S $< -o $@
182 ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${TARGET_ARCH} -S $< -o $@
184 # Rules for preprocessing.
187 ${CPP} ${CFLAGS} ${CPPFLAGS} ${TARGET_ARCH} $< > $@
190 ${CXXCPP} ${CXXFLAGS} ${CPPFLAGS} ${TARGET_ARCH} $< > $@
192 # Rules for assembly language files,
194 ifneq (${ASMFILES_LO},)
196 ifneq ($(filter @host_cpu@,sparc sparc64),)
197 ${ASMFILES_S} : %.s : %.cc
198 ${CXXCPP} ${CXXFLAGS} ${CPPFLAGS} ${TARGET_ARCH} ${ASMFLAGS} $< | grep -v '^#' | grep -v '^ *#line' | sed -e 's/\([.%]\) /\1/g' -e 's/ , /,/g' -e 's/ :/:/g' -e 's/\$$/#/g' > $@
200 ifeq (@host_cpu@,m68k)
201 ${ASMFILES_S} : %.s : %.cc
202 ifeq (@AS_UNDERSCORE@,true)
203 ${CXXCPP} ${CXXFLAGS} ${CPPFLAGS} ${TARGET_ARCH} -P ${ASMFLAGS} $< | sed -e 's/\\#/#/g' -e 's/\$$//g' > $@
205 ${CXXCPP} ${CXXFLAGS} ${CPPFLAGS} ${TARGET_ARCH} -P ${ASMFLAGS} $< | sed -e 's/\\#/#/g' -e 's/\$$/%/g' > $@
208 ifeq (@host_cpu@,hppa)
209 ${ASMFILES_S} : %.s : %.cc
210 -${CXXCPP} ${CXXFLAGS} ${CPPFLAGS} ${TARGET_ARCH} -P ${ASMFLAGS} $< > $@
212 ${ASMFILES_S} : %.s : %.cc
213 ${CXXCPP} ${CXXFLAGS} ${CPPFLAGS} ${TARGET_ARCH} -P ${ASMFLAGS} $< > $@
218 ifeq (@host_cpu@,hppa)
219 # Only the native as groks the .SHORTDATA statements
220 ${ASMFILES_LO} : %.lo : %.s
221 ${LIBTOOL_COMPILE} ${CC} ${CFLAGS} ${TARGET_ARCH} -c $< \
222 || COMPILER_PATH=/usr/ccs/bin ${LIBTOOL_COMPILE} ${CC} ${CFLAGS} ${TARGET_ARCH} -c $< \
223 || COMPILER_PATH=/bin ${LIBTOOL_COMPILE} ${CC} ${CFLAGS} ${TARGET_ARCH} -c $<
225 ${ASMFILES_LO} : %.lo : %.s
226 ${LIBTOOL_COMPILE} ${CC} ${CFLAGS} ${ASMFLAGS} ${TARGET_ARCH} -c $<
234 ${ALLOBJECTS_LO} : ${SUBDIRS_TARGET_ALL}
236 libcln.la : ${LIBTOOL} ${ALLOBJECTS_LO}
237 echo ${ALLOBJECTS_LO} | tr ' ' '\n' > libcln.objectlist
238 ${LIBTOOL_LINK} ${CXX} -o libcln.la -rpath ${libdir} -version-info ${CL_CURRENT}:${CL_REVISION}:${CL_AGE} ${LDFLAGS} ${LIBS} -objectlist libcln.objectlist
241 ${MKDIR} ${DESTDIR}${libdir}
242 ${LIBTOOL_INSTALL} ${INSTALL_PROGRAM} libcln.la ${DESTDIR}${libdir}/libcln.la
243 ${MKDIR} ${DESTDIR}${includedir}/cln
244 ${INSTALL_DATA} ${top_srcdir}/include/cln/*.h ${DESTDIR}${includedir}/cln
245 ${INSTALL_DATA} ../include/cln/*.h ${DESTDIR}${includedir}/cln
248 ${MKDIR} ${DESTDIR}${libdir}
249 ${MKDIR} ${DESTDIR}${includedir}/cln
252 ${LIBTOOL_UNINSTALL} ${RM} ${DESTDIR}${libdir}/libcln.la
253 ${RM} -r ${DESTDIR}${includedir}/cln
260 ${RM} *.s *.o *.lo *.a *.la *.objectlist core
264 ${RM} config.status config.log config.cache Makefile
266 maintainer-clean : distclean