Whamcloud - gitweb
Use MKINSTALLDIRS macro so that the Makefiles can find the script
[tools/e2fsprogs.git] / lib / ss / Makefile.in
1 #
2 # Makefile for lib/ss
3 #
4
5 srcdir = @srcdir@
6 top_srcdir = @top_srcdir@
7 VPATH = @srcdir@
8 top_builddir = ../..
9 my_dir = lib/ss
10 INSTALL = @INSTALL@
11 DLOPEN_LIB = @DLOPEN_LIB@
12
13 @MCONFIG@
14
15 LIBRARY= libss
16 LIBDIR= ss
17
18 ELF_VERSION = 2.0
19 ELF_SO_VERSION = 2
20 ELF_IMAGE = libss
21 ELF_MYDIR = ss
22 ELF_INSTALL_DIR = $(root_libdir)
23 ELF_OTHER_LIBS = -L../.. -lcom_err $(DLOPEN_LIB)
24
25 BSDLIB_VERSION = 1.0
26 BSDLIB_IMAGE = libss
27 BSDLIB_MYDIR = ss
28 BSDLIB_INSTALL_DIR = $(root_libdir)
29
30 TAGS=etags
31 COMPILE_ET=../et/compile_et --build-tree
32 MK_CMDS=_SS_DIR_OVERRIDE=. ./mk_cmds
33
34 # -I.. is so that ss/ss_err.h works
35 # -I$(srcdir)/.. is so that ss/ss.h works
36 # -I$(srcdir)/../et is so com_err.h works
37 XTRA_CFLAGS= -I$(srcdir)/../et
38
39 .c.o:
40         @echo " CC $<"
41         @$(CC) $(ALL_CFLAGS) -c $<
42 @PROFILE_CMT@   @$(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $<
43 @CHECKER_CMT@   @$(CC) $(ALL_CFLAGS) -checker -g -o checker/$*.o -c $<
44 @ELF_CMT@       @$(CC) $(ALL_CFLAGS) -DSHARED_ELF_LIB -fPIC -o elfshared/$*.o -c $<
45 @BSDLIB_CMT@    @$(CC) $(ALL_CFLAGS) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $<
46
47 # for the library
48
49 LIB=    libss.a
50
51 # with ss_err.o first, ss_err.h should get rebuilt first too.  should not
52 # be relying on this, though.
53 OBJS=   ss_err.o \
54         std_rqs.o \
55         invocation.o help.o \
56         execute_cmd.o listen.o parse.o error.o prompt.o \
57         request_tbl.o list_rqs.o pager.o requests.o \
58         data.o get_readline.o
59
60 SRCS=   $(srcdir)/invocation.c $(srcdir)/help.c \
61         $(srcdir)/execute_cmd.c $(srcdir)/listen.c $(srcdir)/parse.c \
62         $(srcdir)/error.c $(srcdir)/prompt.c $(srcdir)/request_tbl.c \
63         $(srcdir)/list_rqs.c $(srcdir)/pager.c $(srcdir)/requests.c \
64         $(srcdir)/data.c $(srcdir)/get_readline.c
65
66 all:: mk_cmds
67
68 @MAKEFILE_LIBRARY@
69 @MAKEFILE_ELF@
70 @MAKEFILE_BSDLIB@
71 @MAKEFILE_PROFILE@
72 @MAKEFILE_CHECKER@
73
74 CODE= $(SRCS) $(MKCMDSFILES)
75
76 MKCMDSOBJS=     mk_cmds.o utils.o options.o ct.tab.o cmd_tbl.lex.o
77
78 MKCMDSFILES=    mk_cmds.c utils.c options.c ct.y cmd_tbl.lex.l
79
80 MKCMDSCSRCS=    mk_cmds.c utils.c options.c ct.tab.c cmd_tbl.lex.c
81
82
83 HFILES= ss.h ss_internal.h
84 SHARE_FILES= ct_c.awk ct_c.sed
85
86 INSTALL_HFILES= ss.h 
87
88 # for 'tags' and dependencies
89
90 CFILES= $(SRCS) $(MKCMDSCSRCS) test_ss.c
91
92 # for building archives
93
94 FILES=  $(SRCS) $(MKCMDSFILES) $(HFILES) \
95         ss_err.et std_rqs.ct Makefile \
96         test_ss.c ss 
97
98 all::   libss.a # libss_p.a lint
99
100 std_rqs.c: std_rqs.ct mk_cmds
101         @echo " MK_CMDS $@"
102         @DIR=$(srcdir) $(MK_CMDS) $(srcdir)/std_rqs.ct
103
104 ss_err.c ss_err.h: ss_err.et
105         @echo " COMPILE_ET $<"
106         @$(COMPILE_ET) $(srcdir)/ss_err.et
107
108 ct.tab.c ct.tab.h: ct.y
109         $(RM) -f ct.tab.* y.*
110         $(YACC) -d $(srcdir)/ct.y
111         $(MV) -f y.tab.c ct.tab.c
112         $(MV) -f y.tab.h ct.tab.h
113
114 #libss.o:       $(OBJS)
115 #       $(LD) -r -s -o $@ $(OBJS)
116 #       $(CHMOD) -x $@
117
118 mk_cmds: $(DEP_SUBSTITUTE) $(srcdir)/mk_cmds.sh.in
119         @echo " SUBST $@"
120         @$(SUBSTITUTE) $(srcdir)/mk_cmds.sh.in mk_cmds
121         @$(CHMOD) +x mk_cmds
122
123 installdirs::
124         $(MKINSTALLDIRS) $(DESTDIR)$(libdir) \
125                 $(DESTDIR)$(includedir)/ss $(DESTDIR)$(datadir)/ss \
126                 $(DESTDIR)$(bindir)
127
128 install:: libss.a $(INSTALL_HFILES) installdirs ss_err.h mk_cmds
129         $(INSTALL_DATA) libss.a $(DESTDIR)$(libdir)/libss.a
130         $(CHMOD) 644 $(DESTDIR)$(libdir)/libss.a
131         -$(RANLIB) $(DESTDIR)$(libdir)/libss.a
132         $(CHMOD) $(LIBMODE) $(DESTDIR)$(libdir)/libss.a
133         $(RM) -f $(DESTDIR)$(includedir)/ss/*
134         for i in $(INSTALL_HFILES); do \
135                 $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/ss/$$i; \
136         done
137         $(INSTALL_DATA) ss_err.h $(DESTDIR)$(includedir)/ss/ss_err.h
138         for i in $(SHARE_FILES); do \
139                 $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(datadir)/ss/$$i; \
140         done
141         $(INSTALL) mk_cmds $(DESTDIR)$(bindir)/mk_cmds
142         $(INSTALL_DATA) $(srcdir)/mk_cmds.1 $(DESTDIR)$(man1dir)/mk_cmds.1
143
144 uninstall::
145         $(RM) -f $(DESTDIR)$(libdir)/libss.a $(DESTDIR)$(bindir)/mk_cmds
146         $(RM) -rf $(DESTDIR)$(includedir)/ss $(DESTDIR)$(datadir)/ss
147
148 clean::
149         $(RM) -f ../libss.a libss.a mk_cmds ss_err.h ss_err.c std_rqs.c \
150                 *.o *~ \#* *.bak core 
151
152 mostlyclean:: clean
153 distclean:: clean
154         $(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old
155
156 #
157 # Hack to parallel makes recognize dependencies correctly.
158 #
159 $(top_builddir)/lib/ss/ss_err.h: ss_err.h
160
161 # +++ Dependency line eater +++
162
163 # Makefile dependencies follow.  This must be the last section in
164 # the Makefile.in file
165 #
166 invocation.o: $(srcdir)/invocation.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
167  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
168 help.o: $(srcdir)/help.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
169  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
170 execute_cmd.o: $(srcdir)/execute_cmd.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
171  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
172 listen.o: $(srcdir)/listen.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
173  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
174 parse.o: $(srcdir)/parse.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
175  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
176 error.o: $(srcdir)/error.c $(top_srcdir)/lib/et/com_err.h \
177  $(srcdir)/ss_internal.h $(srcdir)/ss.h $(top_builddir)/lib/ss/ss_err.h \
178  $(top_srcdir)/lib/et/com_err.h
179 prompt.o: $(srcdir)/prompt.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
180  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
181 request_tbl.o: $(srcdir)/request_tbl.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
182  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
183 list_rqs.o: $(srcdir)/list_rqs.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
184  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
185 pager.o: $(srcdir)/pager.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
186  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
187 requests.o: $(srcdir)/requests.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
188  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
189 data.o: $(srcdir)/data.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
190  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
191 get_readline.o: $(srcdir)/get_readline.c $(srcdir)/ss_internal.h \
192  $(srcdir)/ss.h $(top_builddir)/lib/ss/ss_err.h \
193  $(top_srcdir)/lib/et/com_err.h