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@
15 includedir = @includedir@
19 # Programs used by "make":
28 INCLUDES = -I../include -I$(top_srcdir)/include
29 CPPFLAGS += $(INCLUDES)
32 LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
33 LIBTOOL_LINK = $(LIBTOOL) --mode=link
34 LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
35 LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
43 # Libtool's library interface versions:
44 CL_CURRENT = @CL_CURRENT@
45 CL_REVISION = @CL_REVISION@
48 # Programs used by "make install":
50 INSTALL_PROGRAM = @INSTALL_PROGRAM@
51 INSTALL_DATA = @INSTALL_DATA@
53 #### End of system configuration section. ####
57 # Needed by $(LIBTOOL).
60 # When this Makefile is called with SUBDIR=some_subdirectory, it builds
61 # only the object files belonging to sources in that subdirectory. The
62 # final library is built only if SUBDIR=.
65 # Define the search path for sources.
66 # The ":" below keeps config.status from removing this line.
67 VPATH = $(srcdir)/$(SUBDIR) # :
69 # Add subdirectory specific flags.
70 include $(srcdir)/$(SUBDIR)/Makeflags
71 CPPFLAGS += $(SUBDIR_INCLUDES)
73 # Need to know the system name.
74 SYSTEM := $(shell uname -s)
76 FILES_CC := $(notdir $(wildcard $(srcdir)/$(SUBDIR)/*.cc))
77 FILES_CC := $(filter-out %.i.cc, $(FILES_CC))
78 ASMFILES_CC := $(patsubst cl_asm_@host_cpu@_%.cc,cl_asm_%.cc, $(filter cl_asm_@host_cpu@_%.cc, $(FILES_CC)))
79 FILES_CC := $(filter-out cl_asm_%.cc, $(FILES_CC))
81 FILES_I_CC := $(patsubst %.cc,%.i.cc,$(FILES_CC))
83 FILES_S := $(patsubst %.cc,%.s,$(FILES_CC))
85 FILES_LO := $(patsubst %.cc,%.lo,$(FILES_CC))
87 ASMFILES_S := $(patsubst %.cc,%.s,$(ASMFILES_CC))
89 ASMFILES_LO := $(patsubst %.cc,%.lo,$(ASMFILES_CC))
91 OBJECTS_LO = $(FILES_LO) $(ASMFILES_LO)
93 SUBDIRS := $(patsubst $(srcdir)/%/.,%,$(wildcard $(srcdir)/$(SUBDIR)/*/.))
94 # Avoid certain subdirectories:
95 # private/ and old/ don't contain valid sources,
96 # CVS/ and RCS/ are created when people put the sources under version control,
97 # ii_files/ is created during "make" by SGI C++.
98 SUBDIRS := $(filter-out old ./old private ./private CVS %/CVS RCS %/RCS ii_files ./ii_files,$(SUBDIRS))
100 SUBDIRS_TARGET := $(patsubst %,%.target,$(SUBDIRS))
101 SUBDIRS_DIRDEP := $(patsubst %,%.dirdep,$(SUBDIRS))
104 ALLFILES_CC := $(notdir $(wildcard $(srcdir)/*.cc) $(foreach subdir,$(SUBDIRS), $(wildcard $(srcdir)/$(subdir)/*.cc) $(wildcard $(srcdir)/$(subdir)/*/*.cc) $(wildcard $(srcdir)/$(subdir)/*/*/*.cc)))
105 ALLFILES_CC := $(filter-out %.i.cc, $(ALLFILES_CC))
106 ALLASMFILES_CC := $(patsubst cl_asm_@host_cpu@_%.cc,cl_asm_%.cc, $(filter cl_asm_@host_cpu@_%.cc, $(ALLFILES_CC)))
107 ALLFILES_CC := $(filter-out cl_asm_%.cc, $(ALLFILES_CC))
108 ALLFILES_LO := $(patsubst %.cc,%.lo,$(ALLFILES_CC))
109 ALLASMFILES_LO := $(patsubst %.cc,%.lo,$(ALLASMFILES_CC))
110 ALLOBJECTS_LO = $(ALLFILES_LO) $(ALLASMFILES_LO)
112 all : $(OBJECTS_LO) $(SUBDIRS_TARGET) libcln.la
114 all : $(OBJECTS_LO) $(SUBDIRS_TARGET)
117 alls : $(FILES_S) $(ASMFILES_S)
119 allo : $(FILES_LO) $(ASMFILES_LO)
122 ifeq (@AS_UNDERSCORE@,true)
123 ASMFLAGS += -DUNDERSCORE
126 # Rules for normal compilation.
129 $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
132 $(LIBTOOL_COMPILE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
134 # Rules for normal compilation, only needed for debugging.
137 $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -S $< -o $@
140 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -S $< -o $@
142 # Rules for preprocessing.
145 $(CPP) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $< > $@
148 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $< > $@
150 # Rules for assembly language files,
152 ifneq ($(ASMFILES_LO),)
154 ifneq ($(filter @host_cpu@,sparc sparc64),)
155 $(ASMFILES_S) : %.s : %.cc
156 $(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' > $@
158 ifeq (@host_cpu@,m68k)
159 $(ASMFILES_S) : %.s : %.cc
160 ifeq (@AS_UNDERSCORE@,true)
161 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< | sed -e 's/\\#/#/g' -e 's/\$$//g' > $@
163 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< | sed -e 's/\\#/#/g' -e 's/\$$/%/g' > $@
166 ifeq (@host_cpu@,hppa)
167 $(ASMFILES_S) : %.s : %.cc
168 -$(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< > $@
170 $(ASMFILES_S) : %.s : %.cc
171 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< > $@
176 ifeq (@host_cpu@,hppa)
177 # Only the native as groks the .SHORTDATA statements
178 $(ASMFILES_LO) : %.lo : %.s
179 $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $< \
180 || COMPILER_PATH=/usr/ccs/bin $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $< \
181 || COMPILER_PATH=/bin $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $<
183 $(ASMFILES_LO) : %.lo : %.s
184 $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $<
190 # Recurse into subdirectories
191 $(SUBDIRS_TARGET) : %.target : %.dirdep
194 $(SUBDIRS_DIRDEP) : %.dirdep :
199 libcln.la : $(LIBTOOL) $(ALLOBJECTS_LO)
200 $(LIBTOOL_LINK) $(CC) -o libcln.la -rpath $(libdir) -version-info $(CL_CURRENT):$(CL_REVISION):$(CL_AGE) $(LDFLAGS) $(LIBS) $(ALLOBJECTS_LO)
203 if [ ! -d $(DESTDIR)$(libdir) ] ; then mkdir $(DESTDIR)$(libdir) ; fi
204 $(LIBTOOL_INSTALL) $(INSTALL_DATA) libcln.la $(DESTDIR)$(libdir)/libcln.la
205 if [ ! -d $(DESTDIR)$(includedir) ] ; then mkdir $(DESTDIR)$(includedir) ; fi
206 if [ ! -d $(DESTDIR)$(includedir)/cln ] ; then mkdir $(DESTDIR)$(includedir)/cln ; fi
207 $(INSTALL_DATA) $(top_srcdir)/include/cln/*.h $(DESTDIR)$(includedir)/cln
208 $(INSTALL_DATA) ../include/cln/*.h $(DESTDIR)$(includedir)/cln
209 # if [ ! -d $(DESTDIR)$(mandir) ] ; then mkdir $(DESTDIR)$(mandir) ; fi
210 # if [ ! -d $(DESTDIR)$(mandir)/man3 ] ; then mkdir $(DESTDIR)$(mandir)/man3 ; fi
211 # if [ ! -d $(DESTDIR)$(datadir) ] ; then mkdir $(DESTDIR)$(datadir) ; fi
212 # if [ ! -d $(DESTDIR)$(datadir)/html ] ; then mkdir $(DESTDIR)$(datadir)/html ; fi
215 if [ ! -d $(DESTDIR)$(libdir) ] ; then mkdir $(DESTDIR)$(libdir) ; fi
216 if [ ! -d $(DESTDIR)$(includedir) ] ; then mkdir $(DESTDIR)$(includedir) ; fi
217 if [ ! -d $(DESTDIR)$(includedir)/cln ] ; then mkdir $(DESTDIR)$(includedir)/cln ; fi
218 # if [ ! -d $(DESTDIR)$(mandir) ] ; then mkdir $(DESTDIR)$(mandir) ; fi
219 # if [ ! -d $(DESTDIR)$(mandir)/man3 ] ; then mkdir $(DESTDIR)$(mandir)/man3 ; fi
220 # if [ ! -d $(DESTDIR)$(datadir) ] ; then mkdir $(DESTDIR)$(datadir) ; fi
221 # if [ ! -d $(DESTDIR)$(datadir)/html ] ; then mkdir $(DESTDIR)$(datadir)/html ; fi
224 $(LIBTOOL_UNINSTALL) $(RM) $(DESTDIR)$(libdir)/libcln.la
225 $(RM) -r $(DESTDIR)$(includedir)/cln
232 $(RM) *.s *.o *.lo *.a *.la core
236 $(RM) config.status config.log config.cache Makefile
238 maintainer-clean : distclean