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)
30 LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
31 LIBTOOL_LINK = $(LIBTOOL) --mode=link
32 LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
33 LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
42 # Programs used by "make install":
44 INSTALL_PROGRAM = @INSTALL_PROGRAM@
45 INSTALL_DATA = @INSTALL_DATA@
47 #### End of system configuration section. ####
51 # Needed by $(LIBTOOL).
54 # When this Makefile is called with SUBDIR=some_subdirectory, it builds
55 # only the object files belonging to sources in that subdirectory. The
56 # final library is built only if SUBDIR=.
59 # Define the search path for sources.
60 # The ":" below keeps config.status from removing this line.
61 VPATH = $(srcdir)/$(SUBDIR) # :
63 # Add subdirectory specific flags.
64 include $(srcdir)/$(SUBDIR)/Makeflags
65 CPPFLAGS += $(SUBDIR_INCLUDES)
67 # Need to know the system name.
68 SYSTEM := $(shell uname -s)
70 FILES_CC := $(notdir $(wildcard $(srcdir)/$(SUBDIR)/*.cc))
71 FILES_CC := $(filter-out %.i.cc, $(FILES_CC))
72 ASMFILES_CC := $(patsubst cl_asm_@host_cpu@_%.cc,cl_asm_%.cc, $(filter cl_asm_@host_cpu@_%.cc, $(FILES_CC)))
73 FILES_CC := $(filter-out cl_asm_%.cc, $(FILES_CC))
75 FILES_I_CC := $(patsubst %.cc,%.i.cc,$(FILES_CC))
77 FILES_S := $(patsubst %.cc,%.s,$(FILES_CC))
79 FILES_LO := $(patsubst %.cc,%.lo,$(FILES_CC))
81 ASMFILES_S := $(patsubst %.cc,%.s,$(ASMFILES_CC))
83 ASMFILES_LO := $(patsubst %.cc,%.lo,$(ASMFILES_CC))
85 OBJECTS_LO = $(FILES_LO) $(ASMFILES_LO)
87 SUBDIRS := $(patsubst $(srcdir)/%/.,%,$(wildcard $(srcdir)/$(SUBDIR)/*/.))
88 # Avoid certain subdirectories:
89 # private/ and old/ don't contain valid sources,
90 # CVS/ and RCS/ are created when people put the sources under version control,
91 # ii_files/ is created during "make" by SGI C++.
92 SUBDIRS := $(filter-out old ./old private ./private CVS %/CVS RCS %/RCS ii_files ./ii_files,$(SUBDIRS))
94 SUBDIRS_TARGET := $(patsubst %,%.target,$(SUBDIRS))
95 SUBDIRS_DIRDEP := $(patsubst %,%.dirdep,$(SUBDIRS))
98 ALLFILES_CC := $(notdir $(wildcard $(srcdir)/*.cc) $(foreach subdir,$(SUBDIRS), $(wildcard $(srcdir)/$(subdir)/*.cc) $(wildcard $(srcdir)/$(subdir)/*/*.cc) $(wildcard $(srcdir)/$(subdir)/*/*/*.cc)))
99 ALLFILES_CC := $(filter-out %.i.cc, $(ALLFILES_CC))
100 ALLASMFILES_CC := $(patsubst cl_asm_@host_cpu@_%.cc,cl_asm_%.cc, $(filter cl_asm_@host_cpu@_%.cc, $(ALLFILES_CC)))
101 ALLFILES_CC := $(filter-out cl_asm_%.cc, $(ALLFILES_CC))
102 ALLFILES_LO := $(patsubst %.cc,%.lo,$(ALLFILES_CC))
103 ALLASMFILES_LO := $(patsubst %.cc,%.lo,$(ALLASMFILES_CC))
104 ALLOBJECTS_LO = $(ALLFILES_LO) $(ALLASMFILES_LO)
106 all : $(OBJECTS_LO) $(SUBDIRS_TARGET) libcln.la
108 all : $(OBJECTS_LO) $(SUBDIRS_TARGET)
111 alls : $(FILES_S) $(ASMFILES_S)
113 allo : $(FILES_LO) $(ASMFILES_LO)
116 ifeq (@AS_UNDERSCORE@,true)
117 ASMFLAGS += -DUNDERSCORE
120 # Rules for normal compilation.
123 $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
126 $(LIBTOOL_COMPILE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
128 # Rules for normal compilation, only needed for debugging.
131 $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -S $< -o $@
134 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -S $< -o $@
136 # Rules for preprocessing.
139 $(CPP) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $< > $@
142 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $< > $@
144 # Rules for assembly language files,
146 ifneq ($(ASMFILES_LO),)
148 ifneq ($(filter @host_cpu@,sparc sparc64),)
149 $(ASMFILES_S) : %.s : %.cc
150 $(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' > $@
152 ifeq (@host_cpu@,m68k)
153 $(ASMFILES_S) : %.s : %.cc
154 ifeq (@AS_UNDERSCORE@,true)
155 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< | sed -e 's/\\#/#/g' -e 's/\$$//g' > $@
157 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< | sed -e 's/\\#/#/g' -e 's/\$$/%/g' > $@
160 ifeq (@host_cpu@,hppa)
161 $(ASMFILES_S) : %.s : %.cc
162 -$(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< > $@
164 $(ASMFILES_S) : %.s : %.cc
165 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< > $@
170 ifeq (@host_cpu@,hppa)
171 # Only the native as groks the .SHORTDATA statements
172 $(ASMFILES_LO) : %.lo : %.s
173 $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $< \
174 || COMPILER_PATH=/usr/ccs/bin $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $< \
175 || COMPILER_PATH=/bin $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $<
177 $(ASMFILES_LO) : %.lo : %.s
178 $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $<
184 # Recurse into subdirectories
185 $(SUBDIRS_TARGET) : %.target : %.dirdep
188 $(SUBDIRS_DIRDEP) : %.dirdep :
193 ../gmp/mpn/libmpn.la : $(LIBTOOL)
194 cd ../gmp && $(MAKE) mpn/libmpn.la mp_clz_tab.lo
197 libcln.la : $(LIBTOOL) $(ALLOBJECTS_LO)
198 $(LIBTOOL_LINK) $(CC) -o libcln.la -rpath $(libdir) $(ALLOBJECTS_LO)
201 if [ ! -d $(libdir) ] ; then mkdir $(libdir) ; fi
202 $(LIBTOOL_INSTALL) $(INSTALL_DATA) libcln.la $(libdir)/libcln.la
203 if [ ! -d $(includedir) ] ; then mkdir $(includedir) ; fi
204 $(INSTALL_DATA) $(top_srcdir)/include/*.h $(includedir)
205 $(INSTALL_DATA) ../include/*.h $(includedir)
206 # if [ ! -d $(mandir) ] ; then mkdir $(mandir) ; fi
207 # if [ ! -d $(mandir)/man3 ] ; then mkdir $(mandir)/man3 ; fi
208 # if [ ! -d $(datadir) ] ; then mkdir $(datadir) ; fi
209 # if [ ! -d $(datadir)/html ] ; then mkdir $(datadir)/html ; fi
212 if [ ! -d $(libdir) ] ; then mkdir $(libdir) ; fi
213 if [ ! -d $(includedir) ] ; then mkdir $(includedir) ; fi
214 # if [ ! -d $(mandir) ] ; then mkdir $(mandir) ; fi
215 # if [ ! -d $(mandir)/man3 ] ; then mkdir $(mandir)/man3 ; fi
216 # if [ ! -d $(datadir) ] ; then mkdir $(datadir) ; fi
217 # if [ ! -d $(datadir)/html ] ; then mkdir $(datadir)/html ; fi
220 $(LIBTOOL_UNINSTALL) $(RM) $(libdir)/libcln.la
221 $(RM) $(addprefix $(includedir)/, $(notdir $(wildcard $(top_srcdir)/include/*.h)))
222 $(RM) $(addprefix $(includedir)/, $(notdir $(wildcard ../include/*.h)))
229 $(RM) *.s *.o *.lo *.a *.la core
233 $(RM) config.status config.log config.cache Makefile
235 maintainer-clean : distclean