1 # 2 # Makefile for lib/et 3 # 4 5 srcdir = @srcdir@ 6 top_srcdir = @top_srcdir@ 7 VPATH = @srcdir@ 8 top_builddir = ../.. 9 my_dir = lib/et 10 INSTALL = @INSTALL@ 11 12 DEP_MAKEFILE = $(DEP_LIB_MAKEFILES) 13 14 @MCONFIG@ 15 16 all:: compile_et com_err.pc 17 18 OBJS= error_message.o et_name.o init_et.o com_err.o com_right.o 19 SRCS = $(srcdir)/error_message.c $(srcdir)/et_name.c $(srcdir)/init_et.c \ 20 $(srcdir)/com_err.c $(srcdir)/com_right.c 21 22 HFILES= com_err.h 23 SHARE_FILES= et_c.awk et_h.awk 24 25 LIBRARY= libcom_err 26 LIBDIR= et 27 28 ELF_VERSION = 2.1 29 ELF_SO_VERSION = 2 30 ELF_IMAGE = libcom_err 31 ELF_MYDIR = et 32 ELF_INSTALL_DIR = $(root_libdir) 33 ELF_OTHER_LIBS = @SEM_INIT_LIB@ 34 35 BSDLIB_VERSION = 1.1 36 BSDLIB_IMAGE = libcom_err 37 BSDLIB_MYDIR = et 38 BSDLIB_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 57 compile_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 62 DVI=texi2dvi 63 DVIPS=dvips -o "$@" 64 INFO=@MAKEINFO@ 65 HTML=makeinfo --html --no-split 66 PS2PDF=ps2pdf 67 68 com_err.ps : com_err.dvi 69 com_err.dvi: com_err.texinfo 70 71 com_err.info: $(srcdir)/com_err.texinfo 72 $(E) " MAKEINFO $@" 73 -$(Q) $(INFO) $(srcdir)/com_err.texinfo 74 75 com_err.dvi: $(srcdir)/com_err.texinfo 76 $(E) " TEXI2DVI $@" 77 -$(Q) $(DVI) $(srcdir)/com_err.texinfo 78 79 com_err.ps: com_err.dvi 80 $(E) " DVIPS $@" 81 -$(Q) $(DVIPS) com_err.dvi 82 83 com_err.pdf: com_err.ps 84 $(E) " PS2PDF $@" 85 -$(Q) $(PS2PDF) com_err.ps 86 87 com_err.html: $(srcdir)/com_err.texinfo 88 $(E) " MAKEINFO $@" 89 -$(Q) $(HTML) $(srcdir)/com_err.texinfo 90 91 com_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 99 TAGS: $(SRCS) 100 $(TAGS) $(SRCS) 101 102 installdirs:: 103 $(E) " MKINSTALLDIRS $(libdir) $(includedir)/et $(datadir)/et $(bindir) $(man1dir) $(man3dir)" 104 $(Q) $(MKINSTALLDIRS) $(DESTDIR)$(libdir) \ 105 $(DESTDIR)$(includedir)/et $(DESTDIR)$(datadir)/et \ 106 $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) \ 107 $(DESTDIR)$(man3dir) $(DESTDIR)$(pkgconfigdir) 108 109 install:: 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 134 uninstall:: 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 140 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 152 clean:: 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 160 mostlyclean:: clean 161 distclean:: 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 # 172 error_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 175 et_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 178 init_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 180 com_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 183 com_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