Imported Upstream version 4.1
[platform/upstream/dosfstools.git] / src / Makefile.am
1 # dosfstools src/Makefile.am
2 # Copyright (C) 2015  Andreas Bombe <aeb@debian.org>
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 AM_CFLAGS = -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers \
18             -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings
19
20 sbin_PROGRAMS = fsck.fat mkfs.fat fatlabel
21 noinst_PROGRAMS = testdevinfo
22
23 fscklabel_common_sources = boot.c boot.h check.c check.h common.c common.h \
24                            fat.c fat.h file.c file.h io.c io.h lfn.c lfn.h \
25                            charconv.c charconv.h msdos_fs.h \
26                            fsck.fat.h endian_compat.h
27 fsck_fat_SOURCES = fsck.fat.c $(fscklabel_common_sources)
28 fatlabel_SOURCES = fatlabel.c $(fscklabel_common_sources)
29
30 mkfs_common_sources = device_info.c device_info.h \
31                       blkdev/blkdev.c blkdev/blkdev.h \
32                       endian_compat.h \
33                       blkdev/linux_version.c blkdev/linux_version.h
34 mkfs_fat_SOURCES  = mkfs.fat.c msdos_fs.h $(mkfs_common_sources)
35 mkfs_fat_CPPFLAGS = -I$(srcdir)/blkdev
36 mkfs_fat_CFLAGS   = $(AM_CFLAGS) $(UDEV_CFLAGS)
37 mkfs_fat_LDADD    = $(UDEV_LIBS)
38
39 testdevinfo_SOURCES  = testdevinfo.c $(mkfs_common_sources)
40 testdevinfo_CPPFLAGS = -I$(srcdir)/blkdev
41 testdevinfo_CFLAGS   = $(AM_CFLAGS) $(UDEV_CFLAGS)
42 testdevinfo_LDADD    = $(UDEV_LIBS)
43
44
45 if COMPAT_SYMLINKS
46 install-exec-hook:
47         cd $(DESTDIR)$(sbindir) && $(LN_S) -f fatlabel dosfslabel
48         cd $(DESTDIR)$(sbindir) && $(LN_S) -f fsck.fat dosfsck
49         cd $(DESTDIR)$(sbindir) && $(LN_S) -f fsck.fat fsck.msdos
50         cd $(DESTDIR)$(sbindir) && $(LN_S) -f fsck.fat fsck.vfat
51         cd $(DESTDIR)$(sbindir) && $(LN_S) -f mkfs.fat mkdosfs
52         cd $(DESTDIR)$(sbindir) && $(LN_S) -f mkfs.fat mkfs.msdos
53         cd $(DESTDIR)$(sbindir) && $(LN_S) -f mkfs.fat mkfs.vfat
54
55 uninstall-hook:
56         $(RM) $(DESTDIR)$(sbindir)/dosfslabel
57         $(RM) $(DESTDIR)$(sbindir)/dosfsck
58         $(RM) $(DESTDIR)$(sbindir)/fsck.msdos
59         $(RM) $(DESTDIR)$(sbindir)/fsck.vfat
60         $(RM) $(DESTDIR)$(sbindir)/mkdosfs
61         $(RM) $(DESTDIR)$(sbindir)/mkfs.msdos
62         $(RM) $(DESTDIR)$(sbindir)/mkfs.vfat
63 endif