blob: d6992fc5276a77c8c64fee01e08ecc0601168b34 [file] [log] [blame]
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001# Makefile for the second extended file system utility functions
2#
3# Copyright (C) 1993 Remy Card (card@masi.ibp.fr)
4#
5# This file can be redistributed under the terms of the GNU General
6# Public License
7
8srcdir = @srcdir@
9top_srcdir = @top_srcdir@
10VPATH = @srcdir@
11top_builddir = ../..
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000012my_dir = lib/e2p
Theodore Ts'o50e1e101997-04-26 13:58:21 +000013INSTALL = @INSTALL@
14
15@MCONFIG@
16
Theodore Ts'oe6441862005-01-26 12:59:25 -050017all:: e2p.pc
Theodore Ts'o50e1e101997-04-26 13:58:21 +000018
Theodore Ts'od7b701d1999-09-14 20:17:38 +000019OBJS= feature.o fgetflags.o fsetflags.o fgetversion.o fsetversion.o \
Theodore Ts'oa0c3fd52002-10-15 17:43:43 -040020 getflags.o getversion.o hashstr.o iod.o ls.o mntopts.o \
Theodore Ts'o63253942005-03-19 01:13:22 -050021 parse_num.o pe.o pf.o ps.o setflags.o setversion.o uuid.o \
Theodore Ts'oa8862d92006-08-30 03:08:13 -040022 ostype.o percent.o
Theodore Ts'o50e1e101997-04-26 13:58:21 +000023
Theodore Ts'od7b701d1999-09-14 20:17:38 +000024SRCS= $(srcdir)/feature.c $(srcdir)/fgetflags.c \
25 $(srcdir)/fsetflags.c $(srcdir)/fgetversion.c \
26 $(srcdir)/fsetversion.c $(srcdir)/getflags.c \
Theodore Ts'of606dd32002-11-08 14:31:03 -050027 $(srcdir)/getversion.c $(srcdir)/hashstr.c $(srcdir)/iod.c \
Theodore Ts'o55f4cbd2005-01-05 03:01:06 -050028 $(srcdir)/ls.c $(srcdir)/mntopts.c $(srcdir)/parse_num.c \
29 $(srcdir)/pe.c $(srcdir)/pf.c $(srcdir)/ps.c \
Theodore Ts'o63253942005-03-19 01:13:22 -050030 $(srcdir)/setflags.c $(srcdir)/setversion.c $(srcdir)/uuid.c \
Li Zefanf64b36d2008-08-06 17:09:11 +080031 $(srcdir)/ostype.c $(srcdir)/percent.c
Theodore Ts'odede39b2000-02-11 04:48:03 +000032HFILES= e2p.h
33
Theodore Ts'o50e1e101997-04-26 13:58:21 +000034LIBRARY= libe2p
35LIBDIR= e2p
36
Theodore Ts'o521e3681997-04-29 17:48:10 +000037ELF_VERSION = 2.3
Theodore Ts'o297f47a1997-04-26 14:25:20 +000038ELF_SO_VERSION = 2
Theodore Ts'o50e1e101997-04-26 13:58:21 +000039ELF_IMAGE = libe2p
40ELF_MYDIR = e2p
Theodore Ts'oe5fa0e31998-04-01 02:18:45 +000041ELF_INSTALL_DIR = $(root_libdir)
Theodore Ts'ob2420d42000-07-04 18:51:20 +000042ELF_OTHER_LIBS =
Theodore Ts'o50e1e101997-04-26 13:58:21 +000043
44BSDLIB_VERSION = 2.1
45BSDLIB_IMAGE = libe2p
46BSDLIB_MYDIR = e2p
Theodore Ts'oe5fa0e31998-04-01 02:18:45 +000047BSDLIB_INSTALL_DIR = $(root_libdir)
Theodore Ts'o50e1e101997-04-26 13:58:21 +000048
49@MAKEFILE_LIBRARY@
Theodore Ts'o50e1e101997-04-26 13:58:21 +000050@MAKEFILE_ELF@
51@MAKEFILE_BSDLIB@
52@MAKEFILE_PROFILE@
53@MAKEFILE_CHECKER@
54
55.c.o:
Theodore Ts'oc13351f2009-07-02 00:11:17 -040056 $(E) " CC $<"
57 $(Q) $(CC) $(ALL_CFLAGS) -c $< -o $@
JP Abgralle0ed7402014-03-19 19:08:39 -070058 $(Q) $(CHECK_CMD) $(ALL_CFLAGS) $<
Theodore Ts'oc13351f2009-07-02 00:11:17 -040059@PROFILE_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $<
60@CHECKER_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -checker -g -o checker/$*.o -c $<
61@ELF_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -fPIC -o elfshared/$*.o -c $<
62@BSDLIB_CMT@ $(Q) $(CC) $(ALL_CFLAGS) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $<
Theodore Ts'o50e1e101997-04-26 13:58:21 +000063
Theodore Ts'oe6441862005-01-26 12:59:25 -050064e2p.pc: $(srcdir)/e2p.pc.in $(top_builddir)/config.status
Theodore Ts'oc13351f2009-07-02 00:11:17 -040065 $(E) " CONFIG.STATUS $@"
66 $(Q) cd $(top_builddir); CONFIG_FILES=lib/e2p/e2p.pc ./config.status
Theodore Ts'oe6441862005-01-26 12:59:25 -050067
Theodore Ts'o63253942005-03-19 01:13:22 -050068tst_ostype: $(srcdir)/ostype.c
Theodore Ts'oc13351f2009-07-02 00:11:17 -040069 $(E) " LD $@"
70 $(Q) $(CC) -DTEST_PROGRAM -I$(top_srcdir)/lib -o tst_ostype \
Theodore Ts'o7d9adef2005-06-16 18:41:06 -040071 $(srcdir)/ostype.c $(ALL_CFLAGS)
Theodore Ts'o63253942005-03-19 01:13:22 -050072
Andreas Dilger03efde82008-08-23 21:42:46 -060073tst_feature: $(srcdir)/feature.c
Theodore Ts'oc13351f2009-07-02 00:11:17 -040074 $(E) " LD $@"
75 $(Q) $(CC) -DTEST_PROGRAM -I$(top_srcdir)/lib -o tst_feature \
Andreas Dilger03efde82008-08-23 21:42:46 -060076 $(srcdir)/feature.c $(ALL_CFLAGS)
77
78check:: tst_ostype tst_feature
Theodore Ts'o63253942005-03-19 01:13:22 -050079 ./tst_ostype
Andreas Dilger03efde82008-08-23 21:42:46 -060080 ./tst_feature
Theodore Ts'o63253942005-03-19 01:13:22 -050081
Theodore Ts'o50e1e101997-04-26 13:58:21 +000082installdirs::
Theodore Ts'oc13351f2009-07-02 00:11:17 -040083 $(E) " MKINSTALLDIRS $(libdir) $(includedir)/e2p"
84 $(Q) $(MKINSTALLDIRS) $(DESTDIR)$(libdir) \
Theodore Ts'oe6441862005-01-26 12:59:25 -050085 $(DESTDIR)$(includedir)/e2p $(DESTDIR)$(libdir)/pkgconfig
Theodore Ts'o50e1e101997-04-26 13:58:21 +000086
87install:: all installdirs
Theodore Ts'oc13351f2009-07-02 00:11:17 -040088 $(E) " INSTALL_DATA $(libdir)/libe2p.a"
89 $(Q) $(INSTALL_DATA) libe2p.a $(DESTDIR)$(libdir)/libe2p.a
90 -$(Q) $(RANLIB) $(DESTDIR)$(libdir)/libe2p.a
91 $(Q) $(CHMOD) $(LIBMODE) $(DESTDIR)$(libdir)/libe2p.a
92 $(Q) set -e; for i in $(HFILES); do \
Theodore Ts'o522798d2004-12-15 11:28:55 -050093 echo " INSTALL_DATA $(includedir)/e2p/$$i"; \
Theodore Ts'odede39b2000-02-11 04:48:03 +000094 $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/e2p/$$i; \
95 done
Theodore Ts'oc13351f2009-07-02 00:11:17 -040096 $(E) " INSTALL_DATA $(libdir)/pkgconfig/e2p.pc"
97 $(Q) $(INSTALL_DATA) e2p.pc $(DESTDIR)$(libdir)/pkgconfig/e2p.pc
Theodore Ts'o50e1e101997-04-26 13:58:21 +000098
99uninstall::
Theodore Ts'oe6441862005-01-26 12:59:25 -0500100 $(RM) -f $(DESTDIR)$(libdir)/libe2p.a \
101 $(DESTDIR)$(libdir)/pkgconfig/e2p.pc
Theodore Ts'odede39b2000-02-11 04:48:03 +0000102 $(RM) -rf $(DESTDIR)$(includedir)/e2p
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000103
104clean::
105 $(RM) -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/*
Andreas Dilger03efde82008-08-23 21:42:46 -0600106 $(RM) -f ../libe2p.a ../libe2p_p.a tst_ostype tst_feature
Theodore Ts'o63253942005-03-19 01:13:22 -0500107
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000108mostlyclean:: clean
109distclean:: clean
Theodore Ts'ob7aa0d62005-02-05 15:48:49 -0500110 $(RM) -f .depend Makefile e2p.pc \
111 $(srcdir)/TAGS $(srcdir)/Makefile.in.old
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000112
Theodore Ts'o3ded50b2005-12-10 22:23:01 -0500113$(OBJS): subdirs
114
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000115# +++ Dependency line eater +++
116#
117# Makefile dependencies follow. This must be the last section in
118# the Makefile.in file
119#
JP Abgralle0ed7402014-03-19 19:08:39 -0700120feature.o: $(srcdir)/feature.c $(top_builddir)/lib/config.h \
121 $(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
Theodore Ts'o94b993d2008-08-29 23:26:26 -0400122 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
123 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
124 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
125 $(top_builddir)/lib/ext2fs/ext2_err.h \
126 $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
127 $(top_srcdir)/lib/ext2fs/jfs_user.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h \
128 $(top_srcdir)/lib/ext2fs/jfs_compat.h $(top_srcdir)/lib/ext2fs/kernel-list.h
JP Abgralle0ed7402014-03-19 19:08:39 -0700129fgetflags.o: $(srcdir)/fgetflags.c $(top_builddir)/lib/config.h \
130 $(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000131 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h
JP Abgralle0ed7402014-03-19 19:08:39 -0700132fsetflags.o: $(srcdir)/fsetflags.c $(top_builddir)/lib/config.h \
133 $(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000134 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h
JP Abgralle0ed7402014-03-19 19:08:39 -0700135fgetversion.o: $(srcdir)/fgetversion.c $(top_builddir)/lib/config.h \
136 $(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000137 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h
JP Abgralle0ed7402014-03-19 19:08:39 -0700138fsetversion.o: $(srcdir)/fsetversion.c $(top_builddir)/lib/config.h \
139 $(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000140 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h
JP Abgralle0ed7402014-03-19 19:08:39 -0700141getflags.o: $(srcdir)/getflags.c $(top_builddir)/lib/config.h \
142 $(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000143 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h
JP Abgralle0ed7402014-03-19 19:08:39 -0700144getversion.o: $(srcdir)/getversion.c $(top_builddir)/lib/config.h \
145 $(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000146 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h
JP Abgralle0ed7402014-03-19 19:08:39 -0700147hashstr.o: $(srcdir)/hashstr.c $(top_builddir)/lib/config.h \
148 $(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
Theodore Ts'of606dd32002-11-08 14:31:03 -0500149 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h
JP Abgralle0ed7402014-03-19 19:08:39 -0700150iod.o: $(srcdir)/iod.c $(top_builddir)/lib/config.h \
151 $(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
Theodore Ts'of606dd32002-11-08 14:31:03 -0500152 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h
JP Abgralle0ed7402014-03-19 19:08:39 -0700153ls.o: $(srcdir)/ls.c $(top_builddir)/lib/config.h \
154 $(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
Theodore Ts'o75e93ab2005-05-06 09:37:58 -0400155 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h
JP Abgralle0ed7402014-03-19 19:08:39 -0700156mntopts.o: $(srcdir)/mntopts.c $(top_builddir)/lib/config.h \
157 $(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000158 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h
JP Abgralle0ed7402014-03-19 19:08:39 -0700159parse_num.o: $(srcdir)/parse_num.c $(top_builddir)/lib/config.h \
160 $(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000161 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h
JP Abgralle0ed7402014-03-19 19:08:39 -0700162pe.o: $(srcdir)/pe.c $(top_builddir)/lib/config.h \
163 $(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
164 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h
165pf.o: $(srcdir)/pf.c $(top_builddir)/lib/config.h \
166 $(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
167 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h
168ps.o: $(srcdir)/ps.c $(top_builddir)/lib/config.h \
169 $(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
170 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h
171setflags.o: $(srcdir)/setflags.c $(top_builddir)/lib/config.h \
172 $(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
173 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h
174setversion.o: $(srcdir)/setversion.c $(top_builddir)/lib/config.h \
175 $(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
176 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h
177uuid.o: $(srcdir)/uuid.c $(top_builddir)/lib/config.h \
178 $(top_builddir)/lib/dirpaths.h $(top_builddir)/lib/ext2fs/ext2_types.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000179 $(srcdir)/e2p.h $(top_srcdir)/lib/ext2fs/ext2_fs.h
JP Abgralle0ed7402014-03-19 19:08:39 -0700180ostype.o: $(srcdir)/ostype.c $(top_builddir)/lib/config.h \
181 $(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
Theodore Ts'o75e93ab2005-05-06 09:37:58 -0400182 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h
JP Abgralle0ed7402014-03-19 19:08:39 -0700183percent.o: $(srcdir)/percent.c $(top_builddir)/lib/config.h \
184 $(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
Theodore Ts'o94b993d2008-08-29 23:26:26 -0400185 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h