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@
18 # Programs used by "make":
27 INCLUDES = -I../include -I$(top_srcdir)/include
28 CPPFLAGS += $(INCLUDES)
31 LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
32 LIBTOOL_LINK = $(LIBTOOL) --mode=link
33 LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
34 LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
42 # Libtool's library interface versions:
43 CL_CURRENT = @CL_CURRENT@
44 CL_REVISION = @CL_REVISION@
47 # Programs used by "make install":
49 INSTALL_PROGRAM = @INSTALL_PROGRAM@
50 INSTALL_DATA = @INSTALL_DATA@
52 #### End of system configuration section. ####
56 # Needed by $(LIBTOOL).
59 # When this Makefile is called with SUBDIR=some_subdirectory, it builds
60 # only the object files belonging to sources in that subdirectory. The
61 # final library is built only if SUBDIR=.
64 # Define the search path for sources.
65 # The ":" below keeps config.status from removing this line.
66 VPATH = $(srcdir)/$(SUBDIR) # :
68 # Add subdirectory specific flags.
69 include $(srcdir)/$(SUBDIR)/Makeflags
70 CPPFLAGS += $(SUBDIR_INCLUDES)
72 # Need to know the system name.
73 SYSTEM := $(shell uname -s)
75 FILES_CC := $(notdir $(wildcard $(srcdir)/$(SUBDIR)/*.cc))
76 FILES_CC := $(filter-out %.i.cc, $(FILES_CC))
77 ASMFILES_CC := $(patsubst cl_asm_@host_cpu@_%.cc,cl_asm_%.cc, $(filter cl_asm_@host_cpu@_%.cc, $(FILES_CC)))
78 FILES_CC := $(filter-out cl_asm_%.cc, $(FILES_CC))
80 FILES_I_CC := $(patsubst %.cc,%.i.cc,$(FILES_CC))
82 FILES_S := $(patsubst %.cc,%.s,$(FILES_CC))
84 FILES_LO := $(patsubst %.cc,%.lo,$(FILES_CC))
86 ASMFILES_S := $(patsubst %.cc,%.s,$(ASMFILES_CC))
88 ASMFILES_LO := $(patsubst %.cc,%.lo,$(ASMFILES_CC))
90 OBJECTS_LO = $(FILES_LO) $(ASMFILES_LO)
92 SUBDIRS := $(patsubst $(srcdir)/%/.,%,$(wildcard $(srcdir)/$(SUBDIR)/*/.))
93 # Avoid certain subdirectories:
94 # private/ and old/ don't contain valid sources,
95 # CVS/ and RCS/ are created when people put the sources under version control,
96 # ii_files/ is created during "make" by SGI C++.
97 SUBDIRS := $(filter-out old ./old private ./private CVS %/CVS RCS %/RCS ii_files ./ii_files,$(SUBDIRS))
99 SUBDIRS_TARGET := $(patsubst %,%.target,$(SUBDIRS))
100 SUBDIRS_DIRDEP := $(patsubst %,%.dirdep,$(SUBDIRS))
103 ALLFILES_CC := $(notdir $(wildcard $(srcdir)/*.cc) $(foreach subdir,$(SUBDIRS), $(wildcard $(srcdir)/$(subdir)/*.cc) $(wildcard $(srcdir)/$(subdir)/*/*.cc) $(wildcard $(srcdir)/$(subdir)/*/*/*.cc)))
104 ALLFILES_CC := $(filter-out %.i.cc, $(ALLFILES_CC))
105 ALLASMFILES_CC := $(patsubst cl_asm_@host_cpu@_%.cc,cl_asm_%.cc, $(filter cl_asm_@host_cpu@_%.cc, $(ALLFILES_CC)))
106 ALLFILES_CC := $(filter-out cl_asm_%.cc, $(ALLFILES_CC))
107 ALLFILES_LO := $(patsubst %.cc,%.lo,$(ALLFILES_CC))
108 ALLASMFILES_LO := $(patsubst %.cc,%.lo,$(ALLASMFILES_CC))
109 ALLOBJECTS_LO = $(ALLFILES_LO) $(ALLASMFILES_LO)
111 all : $(OBJECTS_LO) $(SUBDIRS_TARGET) libcln.la
113 all : $(OBJECTS_LO) $(SUBDIRS_TARGET)
116 alls : $(FILES_S) $(ASMFILES_S)
118 allo : $(FILES_LO) $(ASMFILES_LO)
121 ifeq (@AS_UNDERSCORE@,true)
122 ASMFLAGS += -DUNDERSCORE
125 # Rules for normal compilation.
128 $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
131 $(LIBTOOL_COMPILE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
133 # Rules for normal compilation, only needed for debugging.
136 $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -S $< -o $@
139 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -S $< -o $@
141 # Rules for preprocessing.
144 $(CPP) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $< > $@
147 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $< > $@
149 # Rules for assembly language files,
151 ifneq ($(ASMFILES_LO),)
153 ifneq ($(filter @host_cpu@,sparc sparc64),)
154 $(ASMFILES_S) : %.s : %.cc
155 $(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' > $@
157 ifeq (@host_cpu@,m68k)
158 $(ASMFILES_S) : %.s : %.cc
159 ifeq (@AS_UNDERSCORE@,true)
160 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< | sed -e 's/\\#/#/g' -e 's/\$$//g' > $@
162 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< | sed -e 's/\\#/#/g' -e 's/\$$/%/g' > $@
165 ifeq (@host_cpu@,hppa)
166 $(ASMFILES_S) : %.s : %.cc
167 -$(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< > $@
169 $(ASMFILES_S) : %.s : %.cc
170 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< > $@
175 ifeq (@host_cpu@,hppa)
176 # Only the native as groks the .SHORTDATA statements
177 $(ASMFILES_LO) : %.lo : %.s
178 $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $< \
179 || COMPILER_PATH=/usr/ccs/bin $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $< \
180 || COMPILER_PATH=/bin $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $<
182 $(ASMFILES_LO) : %.lo : %.s
183 $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $<
189 # Recurse into subdirectories
190 $(SUBDIRS_TARGET) : %.target : %.dirdep
193 $(SUBDIRS_DIRDEP) : %.dirdep :
198 libcln.la : $(LIBTOOL) $(ALLOBJECTS_LO)
199 $(LIBTOOL_LINK) $(CC) -o libcln.la -rpath $(libdir) -version-info $(CL_CURRENT):$(CL_REVISION):$(CL_AGE) $(LDFLAGS) $(LIBS) $(ALLOBJECTS_LO)
202 if [ ! -d $(libdir) ] ; then mkdir $(libdir) ; fi
203 $(LIBTOOL_INSTALL) $(INSTALL_DATA) libcln.la $(libdir)/libcln.la
204 if [ ! -d $(includedir) ] ; then mkdir $(includedir) ; fi
205 $(INSTALL_DATA) $(top_srcdir)/include/*.h $(includedir)
206 $(INSTALL_DATA) ../include/*.h $(includedir)
207 # if [ ! -d $(mandir) ] ; then mkdir $(mandir) ; fi
208 # if [ ! -d $(mandir)/man3 ] ; then mkdir $(mandir)/man3 ; fi
209 # if [ ! -d $(datadir) ] ; then mkdir $(datadir) ; fi
210 # if [ ! -d $(datadir)/html ] ; then mkdir $(datadir)/html ; fi
213 if [ ! -d $(libdir) ] ; then mkdir $(libdir) ; fi
214 if [ ! -d $(includedir) ] ; then mkdir $(includedir) ; fi
215 # if [ ! -d $(mandir) ] ; then mkdir $(mandir) ; fi
216 # if [ ! -d $(mandir)/man3 ] ; then mkdir $(mandir)/man3 ; fi
217 # if [ ! -d $(datadir) ] ; then mkdir $(datadir) ; fi
218 # if [ ! -d $(datadir)/html ] ; then mkdir $(datadir)/html ; fi
221 $(LIBTOOL_UNINSTALL) $(RM) $(libdir)/libcln.la
222 $(RM) $(addprefix $(includedir)/, $(notdir $(wildcard $(top_srcdir)/include/*.h)))
223 $(RM) $(addprefix $(includedir)/, $(notdir $(wildcard ../include/*.h)))
230 $(RM) *.s *.o *.lo *.a *.la core
234 $(RM) config.status config.log config.cache Makefile
236 maintainer-clean : distclean