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 GMP_INCLUDES = @GMP_INCLUDES@
29 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
43 # Programs used by "make install":
45 INSTALL_PROGRAM = @INSTALL_PROGRAM@
46 INSTALL_DATA = @INSTALL_DATA@
48 #### End of system configuration section. ####
52 # Needed by $(LIBTOOL).
55 # When this Makefile is called with SUBDIR=some_subdirectory, it builds
56 # only the object files belonging to sources in that subdirectory. The
57 # final library is built only if SUBDIR=.
60 # Define the search path for sources.
61 # The ":" below keeps config.status from removing this line.
62 VPATH = $(srcdir)/$(SUBDIR) # :
64 # Add subdirectory specific flags.
65 include $(srcdir)/$(SUBDIR)/Makeflags
66 CPPFLAGS += $(SUBDIR_INCLUDES)
68 # Need to know the system name.
69 SYSTEM := $(shell uname -s)
71 FILES_CC := $(notdir $(wildcard $(srcdir)/$(SUBDIR)/*.cc))
72 FILES_CC := $(filter-out %.i.cc, $(FILES_CC))
73 ASMFILES_CC := $(patsubst cl_asm_@host_cpu@_%.cc,cl_asm_%.cc, $(filter cl_asm_@host_cpu@_%.cc, $(FILES_CC)))
74 FILES_CC := $(filter-out cl_asm_%.cc, $(FILES_CC))
76 FILES_I_CC := $(patsubst %.cc,%.i.cc,$(FILES_CC))
78 FILES_S := $(patsubst %.cc,%.s,$(FILES_CC))
80 FILES_LO := $(patsubst %.cc,%.lo,$(FILES_CC))
82 ASMFILES_S := $(patsubst %.cc,%.s,$(ASMFILES_CC))
84 ASMFILES_LO := $(patsubst %.cc,%.lo,$(ASMFILES_CC))
86 OBJECTS_LO = $(FILES_LO) $(ASMFILES_LO)
88 SUBDIRS := $(patsubst $(srcdir)/%/.,%,$(wildcard $(srcdir)/$(SUBDIR)/*/.))
89 # Avoid certain subdirectories:
90 # private/ and old/ don't contain valid sources,
91 # CVS/ and RCS/ are created when people put the sources under version control,
92 # ii_files/ is created during "make" by SGI C++.
93 SUBDIRS := $(filter-out old ./old private ./private CVS %/CVS RCS %/RCS ii_files ./ii_files,$(SUBDIRS))
95 SUBDIRS_TARGET := $(patsubst %,%.target,$(SUBDIRS))
96 SUBDIRS_DIRDEP := $(patsubst %,%.dirdep,$(SUBDIRS))
99 ALLFILES_CC := $(notdir $(wildcard $(srcdir)/*.cc) $(foreach subdir,$(SUBDIRS), $(wildcard $(srcdir)/$(subdir)/*.cc) $(wildcard $(srcdir)/$(subdir)/*/*.cc) $(wildcard $(srcdir)/$(subdir)/*/*/*.cc)))
100 ALLFILES_CC := $(filter-out %.i.cc, $(ALLFILES_CC))
101 ALLASMFILES_CC := $(patsubst cl_asm_@host_cpu@_%.cc,cl_asm_%.cc, $(filter cl_asm_@host_cpu@_%.cc, $(ALLFILES_CC)))
102 ALLFILES_CC := $(filter-out cl_asm_%.cc, $(ALLFILES_CC))
103 ALLFILES_LO := $(patsubst %.cc,%.lo,$(ALLFILES_CC))
104 ALLASMFILES_LO := $(patsubst %.cc,%.lo,$(ALLASMFILES_CC))
105 ALLOBJECTS_LO = $(ALLFILES_LO) $(ALLASMFILES_LO)
107 all : $(OBJECTS_LO) $(SUBDIRS_TARGET) libcln.la
109 all : $(OBJECTS_LO) $(SUBDIRS_TARGET)
112 alls : $(FILES_S) $(ASMFILES_S)
114 allo : $(FILES_LO) $(ASMFILES_LO)
117 ifeq (@AS_UNDERSCORE@,true)
118 ASMFLAGS += -DUNDERSCORE
121 # Rules for normal compilation.
124 $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
127 $(LIBTOOL_COMPILE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
129 # Rules for normal compilation, only needed for debugging.
132 $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -S $< -o $@
135 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -S $< -o $@
137 # Rules for preprocessing.
140 $(CPP) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $< > $@
143 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $< > $@
145 # Rules for assembly language files,
147 ifneq ($(ASMFILES_LO),)
149 ifneq ($(filter @host_cpu@,sparc sparc64),)
150 $(ASMFILES_S) : %.s : %.cc
151 $(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' > $@
153 ifeq (@host_cpu@,m68k)
154 $(ASMFILES_S) : %.s : %.cc
155 ifeq (@AS_UNDERSCORE@,true)
156 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< | sed -e 's/\\#/#/g' -e 's/\$$//g' > $@
158 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< | sed -e 's/\\#/#/g' -e 's/\$$/%/g' > $@
161 ifeq (@host_cpu@,hppa)
162 $(ASMFILES_S) : %.s : %.cc
163 -$(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< > $@
165 $(ASMFILES_S) : %.s : %.cc
166 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< > $@
171 ifeq (@host_cpu@,hppa)
172 # Only the native as groks the .SHORTDATA statements
173 $(ASMFILES_LO) : %.lo : %.s
174 $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $< \
175 || COMPILER_PATH=/usr/ccs/bin $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $< \
176 || COMPILER_PATH=/bin $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $<
178 $(ASMFILES_LO) : %.lo : %.s
179 $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $<
185 # Recurse into subdirectories
186 $(SUBDIRS_TARGET) : %.target : %.dirdep
189 $(SUBDIRS_DIRDEP) : %.dirdep :
194 ../gmp/mpn/libmpn.la : $(LIBTOOL)
195 cd ../gmp && $(MAKE) mpn/libmpn.la mp_clz_tab.lo
198 libcln.la : $(LIBTOOL) $(ALLOBJECTS_LO) @GMP_OBJDEPS@
199 $(LIBTOOL_LINK) $(CC) -o libcln.la -rpath $(libdir) $(ALLOBJECTS_LO) @GMP_OBJS@
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