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 override CPPFLAGS += $(INCLUDES)
33 LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
34 LIBTOOL_LINK = $(LIBTOOL) --mode=link
35 LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
36 LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
45 # Libtool's library interface versions:
46 CL_CURRENT = @CL_CURRENT@
47 CL_REVISION = @CL_REVISION@
50 # Programs used by "make install":
52 INSTALL_PROGRAM = @INSTALL_PROGRAM@
53 INSTALL_DATA = @INSTALL_DATA@
55 #### End of system configuration section. ####
59 # Needed by $(LIBTOOL).
62 # When this Makefile is called with SUBDIR=some_subdirectory, it builds
63 # only the object files belonging to sources in that subdirectory. The
64 # final library is built only if SUBDIR=.
67 # Define the search path for sources.
68 # The variable $(aux_srcdir) is needed because new versions of aufoconf tend to
69 # remove $(srcdir), ${srcdir} and so on...
71 VPATH = $(aux_srcdir)/$(SUBDIR)
73 # Add subdirectory specific flags.
74 include $(srcdir)/$(SUBDIR)/Makeflags
75 override CPPFLAGS += $(SUBDIR_INCLUDES)
77 # Need to know the system name.
78 SYSTEM := $(shell uname -s)
80 FILES_CC := $(notdir $(wildcard $(srcdir)/$(SUBDIR)/*.cc))
81 FILES_CC := $(filter-out %.i.cc, $(FILES_CC))
82 ASMFILES_CC := $(patsubst cl_asm_@host_cpu@_%.cc,cl_asm_%.cc, $(filter cl_asm_@host_cpu@_%.cc, $(FILES_CC)))
83 FILES_CC := $(filter-out cl_asm_%.cc, $(FILES_CC))
85 FILES_I_CC := $(patsubst %.cc,%.i.cc,$(FILES_CC))
87 FILES_S := $(patsubst %.cc,%.s,$(FILES_CC))
89 FILES_LO := $(patsubst %.cc,%.lo,$(FILES_CC))
91 ASMFILES_S := $(patsubst %.cc,%.s,$(ASMFILES_CC))
93 ASMFILES_LO := $(patsubst %.cc,%.lo,$(ASMFILES_CC))
95 OBJECTS_LO = $(FILES_LO) $(ASMFILES_LO)
97 SUBDIRS := $(patsubst $(srcdir)/%/.,%,$(wildcard $(srcdir)/$(SUBDIR)/*/.))
98 # Avoid certain subdirectories:
99 # private/ and old/ don't contain valid sources,
100 # CVS/, RCS/ and SCCS/ are created when people put the sources under version control,
101 # ii_files/ is created during "make" by SGI C++.
102 SUBDIRS := $(filter-out old ./old private ./private CVS %/CVS RCS %/RCS SCCS %/SCCS ii_files ./ii_files,$(SUBDIRS))
104 SUBDIRS_TARGET := $(patsubst %,%.target,$(SUBDIRS))
105 SUBDIRS_DIRDEP := $(patsubst %,%.dirdep,$(SUBDIRS))
108 ALLFILES_CC := $(notdir $(wildcard $(srcdir)/*.cc) $(foreach subdir,$(SUBDIRS), $(wildcard $(srcdir)/$(subdir)/*.cc) $(wildcard $(srcdir)/$(subdir)/*/*.cc) $(wildcard $(srcdir)/$(subdir)/*/*/*.cc)))
109 ALLFILES_CC := $(filter-out %.i.cc, $(ALLFILES_CC))
110 ALLASMFILES_CC := $(patsubst cl_asm_@host_cpu@_%.cc,cl_asm_%.cc, $(filter cl_asm_@host_cpu@_%.cc, $(ALLFILES_CC)))
111 ALLFILES_CC := $(filter-out cl_asm_%.cc, $(ALLFILES_CC))
112 ALLFILES_LO := $(patsubst %.cc,%.lo,$(ALLFILES_CC))
113 ALLASMFILES_LO := $(patsubst %.cc,%.lo,$(ALLASMFILES_CC))
114 ALLOBJECTS_LO = $(ALLFILES_LO) $(ALLASMFILES_LO)
116 all : $(OBJECTS_LO) $(SUBDIRS_TARGET) libcln.la
118 all : $(OBJECTS_LO) $(SUBDIRS_TARGET)
121 alls : $(FILES_S) $(ASMFILES_S)
123 allo : $(FILES_LO) $(ASMFILES_LO)
126 ifeq (@AS_UNDERSCORE@,true)
127 ASMFLAGS += -DUNDERSCORE
130 # Rules for normal compilation.
133 $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
136 $(LIBTOOL_COMPILE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
138 # Rules for normal compilation, only needed for debugging.
141 $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -S $< -o $@
144 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -S $< -o $@
146 # Rules for preprocessing.
149 $(CPP) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $< > $@
152 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $< > $@
154 # Rules for assembly language files,
156 ifneq ($(ASMFILES_LO),)
158 ifneq ($(filter @host_cpu@,sparc sparc64),)
159 $(ASMFILES_S) : %.s : %.cc
160 $(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' > $@
162 ifeq (@host_cpu@,m68k)
163 $(ASMFILES_S) : %.s : %.cc
164 ifeq (@AS_UNDERSCORE@,true)
165 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< | sed -e 's/\\#/#/g' -e 's/\$$//g' > $@
167 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< | sed -e 's/\\#/#/g' -e 's/\$$/%/g' > $@
170 ifeq (@host_cpu@,hppa)
171 $(ASMFILES_S) : %.s : %.cc
172 -$(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< > $@
174 $(ASMFILES_S) : %.s : %.cc
175 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< > $@
180 ifeq (@host_cpu@,hppa)
181 # Only the native as groks the .SHORTDATA statements
182 $(ASMFILES_LO) : %.lo : %.s
183 $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $< \
184 || COMPILER_PATH=/usr/ccs/bin $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $< \
185 || COMPILER_PATH=/bin $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $<
187 $(ASMFILES_LO) : %.lo : %.s
188 $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $<
194 # Recurse into subdirectories
195 $(SUBDIRS_TARGET) : %.target : %.dirdep
198 $(SUBDIRS_DIRDEP) : %.dirdep :
203 $(ALLOBJECTS_LO) : $(SUBDIRS_TARGET)
205 libcln.la : $(LIBTOOL) $(ALLOBJECTS_LO)
206 $(LIBTOOL_LINK) $(CXX) -o libcln.la -rpath $(libdir) -version-info $(CL_CURRENT):$(CL_REVISION):$(CL_AGE) $(LDFLAGS) $(LIBS) $(ALLOBJECTS_LO)
209 $(MKDIR) $(DESTDIR)$(libdir)
210 $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) libcln.la $(DESTDIR)$(libdir)/libcln.la
211 $(MKDIR) $(DESTDIR)$(includedir)/cln
212 $(INSTALL_DATA) $(top_srcdir)/include/cln/*.h $(DESTDIR)$(includedir)/cln
213 $(INSTALL_DATA) ../include/cln/*.h $(DESTDIR)$(includedir)/cln
216 $(MKDIR) $(DESTDIR)$(libdir)
217 $(MKDIR) $(DESTDIR)$(includedir)/cln
220 $(LIBTOOL_UNINSTALL) $(RM) $(DESTDIR)$(libdir)/libcln.la
221 $(RM) -r $(DESTDIR)$(includedir)/cln
228 $(RM) *.s *.o *.lo *.a *.la core
232 $(RM) config.status config.log config.cache Makefile
234 maintainer-clean : distclean