Add macro make_build in spec file
[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 EXTRA_DIST = blkdev/README
23
24 charconv_common_sources = charconv.c charconv.h
25 charconv_common_ldadd = $(LIBICONV)
26 fscklabel_common_sources = boot.c boot.h common.c common.h \
27                            fat.c fat.h io.c io.h msdos_fs.h \
28                            $(charconv_common_sources) \
29                            fsck.fat.h endian_compat.h
30 fsck_fat_SOURCES = check.c check.h file.c file.h fsck.fat.c \
31                    lfn.c lfn.h \
32                    $(fscklabel_common_sources)
33 fsck_fat_LDADD = $(charconv_common_ldadd)
34 fatlabel_SOURCES = fatlabel.c $(fscklabel_common_sources)
35 fatlabel_LDADD = $(charconv_common_ldadd)
36
37 devinfo_common_sources = device_info.c device_info.h \
38                          blkdev/blkdev.c blkdev/blkdev.h \
39                          blkdev/linux_version.c blkdev/linux_version.h
40 mkfs_fat_SOURCES  = mkfs.fat.c msdos_fs.h common.c common.h endian_compat.h \
41                     $(charconv_common_sources) $(devinfo_common_sources)
42 mkfs_fat_CPPFLAGS = -I$(srcdir)/blkdev
43 mkfs_fat_CFLAGS   = $(AM_CFLAGS)
44 mkfs_fat_LDADD    = $(charconv_common_ldadd)
45
46 testdevinfo_SOURCES  = testdevinfo.c $(devinfo_common_sources)
47 testdevinfo_CPPFLAGS = -I$(srcdir)/blkdev
48 testdevinfo_CFLAGS   = $(AM_CFLAGS)
49
50
51 if COMPAT_SYMLINKS
52 install-exec-hook:
53         cd $(DESTDIR)$(sbindir) && $(LN_S) -f fatlabel dosfslabel
54         cd $(DESTDIR)$(sbindir) && $(LN_S) -f fsck.fat dosfsck
55         cd $(DESTDIR)$(sbindir) && $(LN_S) -f fsck.fat fsck.msdos
56         cd $(DESTDIR)$(sbindir) && $(LN_S) -f fsck.fat fsck.vfat
57         cd $(DESTDIR)$(sbindir) && $(LN_S) -f mkfs.fat mkdosfs
58         cd $(DESTDIR)$(sbindir) && $(LN_S) -f mkfs.fat mkfs.msdos
59         cd $(DESTDIR)$(sbindir) && $(LN_S) -f mkfs.fat mkfs.vfat
60
61 uninstall-hook:
62         $(RM) $(DESTDIR)$(sbindir)/dosfslabel
63         $(RM) $(DESTDIR)$(sbindir)/dosfsck
64         $(RM) $(DESTDIR)$(sbindir)/fsck.msdos
65         $(RM) $(DESTDIR)$(sbindir)/fsck.vfat
66         $(RM) $(DESTDIR)$(sbindir)/mkdosfs
67         $(RM) $(DESTDIR)$(sbindir)/mkfs.msdos
68         $(RM) $(DESTDIR)$(sbindir)/mkfs.vfat
69 endif