1# 2# Makefile for lib/et 3# 4 5srcdir = @srcdir@ 6top_srcdir = @top_srcdir@ 7VPATH = @srcdir@ 8top_builddir = ../.. 9my_dir = lib/et 10INSTALL = @INSTALL@ 11 12DEP_MAKEFILE = $(DEP_LIB_MAKEFILES) 13 14@MCONFIG@ 15 16all:: compile_et com_err.pc 17 18OBJS= error_message.o et_name.o init_et.o com_err.o com_right.o 19SRCS = $(srcdir)/error_message.c $(srcdir)/et_name.c $(srcdir)/init_et.c \ 20 $(srcdir)/com_err.c $(srcdir)/com_right.c 21 22HFILES= com_err.h 23SHARE_FILES= et_c.awk et_h.awk 24 25LIBRARY= libcom_err 26LIBDIR= et 27 28ELF_VERSION = 2.1 29ELF_SO_VERSION = 2 30ELF_IMAGE = libcom_err 31ELF_MYDIR = et 32ELF_INSTALL_DIR = $(root_libdir) 33ELF_OTHER_LIBS = @SEM_INIT_LIB@ 34 35BSDLIB_VERSION = 1.1 36BSDLIB_IMAGE = libcom_err 37BSDLIB_MYDIR = et 38BSDLIB_INSTALL_DIR = $(root_libdir) 39 40# 41# what to build... 42# 43.c.o: 44 $(E) " CC $<" 45 $(Q) $(CC) $(ALL_CFLAGS_STLIB) -c $< -o $@ 46 $(Q) $(CHECK_CMD) $(ALL_CFLAGS) $< 47 $(Q) $(CPPCHECK_CMD) $(CPPFLAGS) $< 48@PROFILE_CMT@ $(Q) $(CC) $(ALL_CFLAGS_STLIB) -g -pg -o profiled/$*.o -c $< 49@ELF_CMT@ $(Q) $(CC) $(ALL_CFLAGS_SHLIB) -fPIC -shared -o elfshared/$*.o -c $< 50@BSDLIB_CMT@ $(Q) $(CC) $(ALL_CFLAGS_SHLIB) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $< 51 52@MAKEFILE_LIBRARY@ 53@MAKEFILE_ELF@ 54@MAKEFILE_BSDLIB@ 55@MAKEFILE_PROFILE@ 56 57compile_et: $(DEP_SUBSTITUTE) $(srcdir)/compile_et.sh.in 58 $(E) " SUBST $@" 59 $(Q) $(SUBSTITUTE) $(srcdir)/compile_et.sh.in compile_et 60 $(Q) $(CHMOD) +x compile_et 61 62DVI=texi2dvi 63DVIPS=dvips -o "$@" 64INFO=@MAKEINFO@ 65HTML=makeinfo --html --no-split 66PS2PDF=ps2pdf 67 68com_err.ps : com_err.dvi 69com_err.dvi: com_err.texinfo 70 71com_err.info: $(srcdir)/com_err.texinfo 72 $(E) " MAKEINFO $@" 73 -$(Q) $(INFO) $(srcdir)/com_err.texinfo 74 75com_err.dvi: $(srcdir)/com_err.texinfo 76 $(E) " TEXI2DVI $@" 77 -$(Q) $(DVI) $(srcdir)/com_err.texinfo 78 79com_err.ps: com_err.dvi 80 $(E) " DVIPS $@" 81 -$(Q) $(DVIPS) com_err.dvi 82 83com_err.pdf: com_err.ps 84 $(E) " PS2PDF $@" 85 -$(Q) $(PS2PDF) com_err.ps 86 87com_err.html: $(srcdir)/com_err.texinfo 88 $(E) " MAKEINFO $@" 89 -$(Q) $(HTML) $(srcdir)/com_err.texinfo 90 91com_err.pc: $(srcdir)/com_err.pc.in $(top_builddir)/config.status 92 $(E) " CONFIG.STATUS $@" 93 $(Q) cd $(top_builddir); CONFIG_FILES=lib/et/com_err.pc ./config.status 94 95#libcom_err.o: $(LIBOBJS) 96# $(LD) -r -s -o libcom_err.o $(LIBOBJS) 97# chmod -x libcom_err.o 98 99TAGS: $(SRCS) 100 $(TAGS) $(SRCS) 101 102installdirs:: 103 $(E) " MKDIR_P $(libdir) $(includedir)/et $(datadir)/et $(bindir) $(man1dir) $(man3dir)" 104 $(Q) $(MKDIR_P) $(DESTDIR)$(libdir) \ 105 $(DESTDIR)$(includedir)/et $(DESTDIR)$(datadir)/et \ 106 $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) \ 107 $(DESTDIR)$(man3dir) $(DESTDIR)$(pkgconfigdir) 108 109install:: compile_et libcom_err.a $(HFILES) installdirs com_err.pc 110 $(E) " INSTALL_DATA $(libdir)/libcom_err.a" 111 $(Q) $(INSTALL_DATA) libcom_err.a $(DESTDIR)$(libdir)/libcom_err.a 112 -$(Q) $(RANLIB) $(DESTDIR)$(libdir)/libcom_err.a 113 $(Q) $(CHMOD) $(LIBMODE) $(DESTDIR)$(libdir)/libcom_err.a 114 $(Q) for i in $(HFILES); do \ 115 echo " INSTALL_DATA $(includedir)/et/$$i"; \ 116 $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/et/$$i; \ 117 done 118 $(Q) (cd $(DESTDIR)$(includedir) ;\ 119 $(LN) $(LINK_INSTALL_FLAGS) et/com_err.h . ) 120 $(Q) for i in $(SHARE_FILES); do \ 121 echo " INSTALL_DATA $(datadir)/et/$$i"; \ 122 $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(datadir)/et/$$i; \ 123 done 124 $(E) " INSTALL_SCRIPT $(bindir)/compile_et" 125 $(Q) $(INSTALL_SCRIPT) compile_et $(DESTDIR)$(bindir)/compile_et 126 $(E) " INSTALL_DATA $(man3dir)/com_err.3" 127 $(Q) $(INSTALL_DATA) $(srcdir)/com_err.3 $(DESTDIR)$(man3dir)/com_err.3 128 $(E) " INSTALL_DATA $(man1dir)/compile_et.1" 129 $(Q) $(INSTALL_DATA) $(srcdir)/compile_et.1 \ 130 $(DESTDIR)$(man1dir)/compile_et.1 131 $(E) " INSTALL_DATA $(pkgconfigdir)/com_err.pc" 132 $(Q) $(INSTALL_DATA) com_err.pc $(DESTDIR)$(pkgconfigdir)/com_err.pc 133 134uninstall:: 135 $(RM) -f $(DESTDIR)$(libdir)/libcom_err.a \ 136 $(DESTDIR)$(bindir)/compile_et \ 137 $(DESTDIR)$(pkgconfigdir)/com_err.pc 138 $(RM) -rf $(DESTDIR)$(includedir)/et $(DESTDIR)$(datadir)/et 139 140fullcheck check:: compile_et 141 for i in $(srcdir)/test_cases/*.et ; do \ 142 t=`basename $$i | sed -e 's/.et//'`; \ 143 _ET_DIR_OVERRIDE=$(srcdir) ./compile_et $$i ; \ 144 diff -c $(srcdir)/test_cases/$$t.c $$t.c > $$t.failed; \ 145 if [ $$? -ne 0 ]; then echo Test case $$t failed; exit 1 ; fi ; \ 146 diff -c $(srcdir)/test_cases/$$t.h $$t.h >> $$t.failed; \ 147 if [ $$? -ne 0 ]; then echo Test case $$t failed; exit 1 ; fi ; \ 148 $(RM) -f $$t.c $$t.h $$t.failed; \ 149 echo "Test case $$t succeeded" ; \ 150 done 151 152clean:: 153 $(RM) -f compile_et libcom_err.a libcom_err_p.a com_err.info 154 $(RM) -f $(OBJS) profiled/* 155 $(RM) -f *~ \#* *.bak *.otl *.aux *.toc *.PS *.dvi *.ps TAGS *.ln \ 156 *.html *.cp *.fn *.fns *.ky *.log *.pc *.pg *.toc *.tp *.vr \ 157 *.pdf 158 $(RM) -f ../libcom_err.a ../libcom_err_p.a 159 160mostlyclean:: clean 161distclean:: clean 162 $(RM) -f .depend Makefile com_err.pc \ 163 $(srcdir)/TAGS $(srcdir)/Makefile.in.old 164 165$(OBJS): subdirs 166 167# +++ Dependency line eater +++ 168# 169# Makefile dependencies follow. This must be the last section in 170# the Makefile.in file 171# 172error_message.o: $(srcdir)/error_message.c $(top_builddir)/lib/config.h \ 173 $(top_builddir)/lib/dirpaths.h $(srcdir)/com_err.h $(srcdir)/error_table.h \ 174 $(srcdir)/internal.h 175et_name.o: $(srcdir)/et_name.c $(top_builddir)/lib/config.h \ 176 $(top_builddir)/lib/dirpaths.h $(srcdir)/com_err.h $(srcdir)/error_table.h \ 177 $(srcdir)/internal.h 178init_et.o: $(srcdir)/init_et.c $(top_builddir)/lib/config.h \ 179 $(top_builddir)/lib/dirpaths.h $(srcdir)/com_err.h $(srcdir)/error_table.h 180com_err.o: $(srcdir)/com_err.c $(top_builddir)/lib/config.h \ 181 $(top_builddir)/lib/dirpaths.h $(srcdir)/com_err.h $(srcdir)/error_table.h \ 182 $(srcdir)/internal.h 183com_right.o: $(srcdir)/com_right.c $(top_builddir)/lib/config.h \ 184 $(top_builddir)/lib/dirpaths.h $(srcdir)/com_err.h $(srcdir)/error_table.h 185