summaryrefslogtreecommitdiffstats
path: root/lib/et/Makefile.in
blob: d411f231cf3ce4300f69d17d61c51ca1e47d51ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#
# Makefile for lib/et
#

srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
top_builddir = ../..
my_dir = lib/et
INSTALL = @INSTALL@
MKDIR_P = @MKDIR_P@

DEP_MAKEFILE = $(DEP_LIB_MAKEFILES)

@MCONFIG@

all:: compile_et com_err.pc

OBJS= error_message.o et_name.o init_et.o com_err.o com_right.o
SRCS = $(srcdir)/error_message.c $(srcdir)/et_name.c $(srcdir)/init_et.c \
	$(srcdir)/com_err.c $(srcdir)/com_right.c

HFILES= com_err.h
SHARE_FILES= et_c.awk et_h.awk

LIBRARY= libcom_err
LIBDIR= et

ELF_VERSION = 2.1
ELF_SO_VERSION = 2
ELF_IMAGE = libcom_err
ELF_MYDIR = et
ELF_INSTALL_DIR = $(root_libdir)
ELF_OTHER_LIBS = @SEM_INIT_LIB@

BSDLIB_VERSION = 1.1
BSDLIB_IMAGE = libcom_err
BSDLIB_MYDIR = et
BSDLIB_INSTALL_DIR = $(root_libdir)

#
# what to build...
#
.c.o:
	$(E) "	CC $<"
	$(Q) $(CC) $(ALL_CFLAGS_STLIB) -c $< -o $@
	$(Q) $(CHECK_CMD) $(ALL_CFLAGS) $<
	$(Q) $(CPPCHECK_CMD) $(CPPFLAGS) $<
@PROFILE_CMT@	$(Q) $(CC) $(ALL_CFLAGS_STLIB) -g -pg -o profiled/$*.o -c $<
@ELF_CMT@	$(Q) $(CC) $(ALL_CFLAGS_SHLIB) -fPIC -shared -o elfshared/$*.o -c $<
@BSDLIB_CMT@	$(Q) $(CC) $(ALL_CFLAGS_SHLIB) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $<

@MAKEFILE_LIBRARY@
@MAKEFILE_ELF@
@MAKEFILE_BSDLIB@
@MAKEFILE_PROFILE@

compile_et: $(DEP_SUBSTITUTE) $(srcdir)/compile_et.sh.in
	$(E) "	SUBST $@"
	$(Q) $(SUBSTITUTE) $(srcdir)/compile_et.sh.in compile_et
	$(Q) $(CHMOD) +x compile_et

DVI=texi2dvi
DVIPS=dvips -o "$@"
INFO=@MAKEINFO@
HTML=makeinfo --html --no-split
PS2PDF=ps2pdf

com_err.ps : com_err.dvi
com_err.dvi: com_err.texinfo

com_err.info: $(srcdir)/com_err.texinfo
	$(E) "	MAKEINFO $@"
	-$(Q) $(INFO) $(srcdir)/com_err.texinfo

com_err.dvi: $(srcdir)/com_err.texinfo
	$(E) "	TEXI2DVI $@"
	-$(Q) $(DVI) $(srcdir)/com_err.texinfo

com_err.ps: com_err.dvi
	$(E) "	DVIPS $@"
	-$(Q) $(DVIPS) com_err.dvi

com_err.pdf: com_err.ps
	$(E) "	PS2PDF $@"
	-$(Q) $(PS2PDF) com_err.ps

com_err.html: $(srcdir)/com_err.texinfo
	$(E) "	MAKEINFO $@"
	-$(Q) $(HTML) $(srcdir)/com_err.texinfo

com_err.pc: $(srcdir)/com_err.pc.in $(top_builddir)/config.status
	$(E) "	CONFIG.STATUS $@"
	$(Q) cd $(top_builddir); CONFIG_FILES=lib/et/com_err.pc ./config.status

#libcom_err.o:	$(LIBOBJS)
#	$(LD) -r -s -o libcom_err.o $(LIBOBJS)
#	chmod -x libcom_err.o

TAGS:	$(SRCS)
	$(TAGS) $(SRCS)

installdirs::
	$(E) "	MKDIR_P $(libdir) $(includedir)/et $(datadir)/et $(bindir) $(man1dir) $(man3dir)"
	$(Q) $(MKDIR_P) $(DESTDIR)$(libdir) \
		$(DESTDIR)$(includedir)/et $(DESTDIR)$(datadir)/et \
		$(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) \
		$(DESTDIR)$(man3dir) $(DESTDIR)$(pkgconfigdir)

install:: compile_et libcom_err.a $(HFILES) installdirs com_err.pc
	$(E) "	INSTALL_DATA $(libdir)/libcom_err.a"
	$(Q) $(INSTALL_DATA) libcom_err.a $(DESTDIR)$(libdir)/libcom_err.a
	-$(Q) $(RANLIB) $(DESTDIR)$(libdir)/libcom_err.a
	$(Q) $(CHMOD) $(LIBMODE) $(DESTDIR)$(libdir)/libcom_err.a
	$(Q) for i in $(HFILES); do \
		echo "	INSTALL_DATA $(includedir)/et/$$i"; \
		$(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/et/$$i; \
	done
	$(Q) (cd $(DESTDIR)$(includedir) ;\
		$(LN) $(LINK_INSTALL_FLAGS) et/com_err.h . )
	$(Q) for i in $(SHARE_FILES); do \
		echo "	INSTALL_DATA $(datadir)/et/$$i"; \
		$(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(datadir)/et/$$i; \
	done
	$(E) "	INSTALL_SCRIPT $(bindir)/compile_et"
	$(Q) $(INSTALL_SCRIPT) compile_et $(DESTDIR)$(bindir)/compile_et
	$(E) "	INSTALL_DATA $(man3dir)/com_err.3"
	$(Q) $(INSTALL_DATA) $(srcdir)/com_err.3 $(DESTDIR)$(man3dir)/com_err.3
	$(E) "	INSTALL_DATA $(man1dir)/compile_et.1"
	$(Q) $(INSTALL_DATA) $(srcdir)/compile_et.1 \
			$(DESTDIR)$(man1dir)/compile_et.1
	$(E) "	INSTALL_DATA $(pkgconfigdir)/com_err.pc"
	$(Q) $(INSTALL_DATA) com_err.pc $(DESTDIR)$(pkgconfigdir)/com_err.pc

uninstall::
	$(RM) -f $(DESTDIR)$(libdir)/libcom_err.a \
		$(DESTDIR)$(bindir)/compile_et \
		$(DESTDIR)$(pkgconfigdir)/com_err.pc
	$(RM) -rf $(DESTDIR)$(includedir)/et $(DESTDIR)$(datadir)/et

fullcheck check:: compile_et
	for i in $(srcdir)/test_cases/*.et ; do \
		t=`basename $$i | sed -e 's/.et//'`; \
		_ET_DIR_OVERRIDE=$(srcdir) ./compile_et $$i ; \
		diff -c $(srcdir)/test_cases/$$t.c $$t.c > $$t.failed; \
		if [ $$? -ne 0 ]; then echo Test case $$t failed; exit 1 ; fi ; \
		diff -c $(srcdir)/test_cases/$$t.h $$t.h >> $$t.failed; \
		if [ $$? -ne 0 ]; then echo Test case $$t failed; exit 1 ; fi ; \
		$(RM) -f $$t.c $$t.h $$t.failed; \
		echo "Test case $$t succeeded" ; \
	done

clean::
	$(RM) -f compile_et libcom_err.a libcom_err_p.a com_err.info
	$(RM) -f $(OBJS) profiled/*
	$(RM) -f *~ \#* *.bak *.otl *.aux *.toc *.PS *.dvi *.ps TAGS *.ln \
		*.html *.cp *.fn *.fns *.ky *.log *.pc *.pg *.toc *.tp *.vr \
		*.pdf
	$(RM) -f ../libcom_err.a ../libcom_err_p.a

mostlyclean:: clean
distclean:: clean
	$(RM) -f .depend Makefile com_err.pc \
		$(srcdir)/TAGS $(srcdir)/Makefile.in.old

$(OBJS): subdirs

# +++ Dependency line eater +++
# 
# Makefile dependencies follow.  This must be the last section in
# the Makefile.in file
#
error_message.o: $(srcdir)/error_message.c $(top_builddir)/lib/config.h \
 $(top_builddir)/lib/dirpaths.h $(srcdir)/com_err.h $(srcdir)/error_table.h \
 $(srcdir)/internal.h
et_name.o: $(srcdir)/et_name.c $(top_builddir)/lib/config.h \
 $(top_builddir)/lib/dirpaths.h $(srcdir)/com_err.h $(srcdir)/error_table.h \
 $(srcdir)/internal.h
init_et.o: $(srcdir)/init_et.c $(top_builddir)/lib/config.h \
 $(top_builddir)/lib/dirpaths.h $(srcdir)/com_err.h $(srcdir)/error_table.h
com_err.o: $(srcdir)/com_err.c $(top_builddir)/lib/config.h \
 $(top_builddir)/lib/dirpaths.h $(srcdir)/com_err.h $(srcdir)/error_table.h \
 $(srcdir)/internal.h
com_right.o: $(srcdir)/com_right.c $(top_builddir)/lib/config.h \
 $(top_builddir)/lib/dirpaths.h $(srcdir)/com_err.h $(srcdir)/error_table.h