Utils use _GNU_SOURCE
[platform/upstream/kbd.git] / src / Makefile.am
index f4f6414..bfea328 100644 (file)
@@ -1,10 +1,12 @@
-WARNINGS = -Wall -Wextra -Wmissing-noreturn -Wdisabled-optimization \
-       -Wcast-align -Wshadow -Wmissing-format-attribute -Wmissing-prototypes \
-       -Wstrict-prototypes -Wmissing-declarations
-
-AM_CPPFLAGS = -DDATADIR=\"$(datadir)\" -DLOCALEDIR=\"$(localedir)\" $(WARNINGS) \
+AM_CPPFLAGS = \
+       -I$(srcdir)/libkeymap -I$(builddir)/libkeymap \
+       -I$(srcdir)/libkeymap/keymap -I$(builddir)/libkeymap/keymap \
+       -DDATADIR=\"$(datadir)\" -DLOCALEDIR=\"$(localedir)\" \
+       -D_FORTIFY_SOURCE=2 \
        -funit-at-a-time
 
+SUBDIRS = vlock libkeymap
+
 OLDPROGS = mapscrn loadunimap
 PROGS = \
        dumpkeys loadkeys showkey setfont showconsolefont \
@@ -29,50 +31,55 @@ dist_bin_SCRIPTS = unicode_start unicode_stop
 bin_PROGRAMS = $(OLDPROGS) $(PROGS)
 
 EXTRA_DIST = \
-       analyze.c analyze.l wctomb.c totextmode.c \
-       README.cad README.init README.openvt \
+       wctomb.c \
+       totextmode.c README.cad README.init README.openvt \
        cad
 
-ALL_S   = modifiers.h nls.h paths.h version.h kbd.h
-FIND_S  = findfile.c findfile.h
-GETFD_S = getfd.c getfd.h
-KDMA_S  = kdmapop.c kdmapop.h
-KSYMS_S = ksyms.c ksyms.h cp1250.syms.h ethiopic.syms.h koi8.syms.h sami.syms.h thai.syms.h
-PSF_S   = psf.h psffontop.c psffontop.h
-UNIM_S  = loadunimap.c loadunimap.h
-UTF8_S  = utf8.c utf8.h
-XMAL_S  = xmalloc.c xmalloc.h
-
-chvt_SOURCES            = $(ALL_S) chvt.c $(GETFD_S)
-clrunimap_SOURCES       = $(ALL_S) clrunimap.c $(GETFD_S) $(KDMA_S)
-deallocvt_SOURCES       = $(ALL_S) deallocvt.c $(GETFD_S)
-dumpkeys_SOURCES        = $(ALL_S) dumpkeys.c $(GETFD_S) $(KSYMS_S) $(XMAL_S)
-fgconsole_SOURCES       = $(ALL_S) fgconsole.c $(GETFD_S)
-getkeycodes_SOURCES     = $(ALL_S) getkeycodes.c $(GETFD_S)
-getunimap_SOURCES       = $(ALL_S) getunimap.c $(GETFD_S) $(KDMA_S)
-kbd_mode_SOURCES        = $(ALL_S) kbd_mode.c $(GETFD_S)
-loadunimap_SOURCES      = $(ALL_S) loadunimap.c $(FIND_S) $(PSF_S) $(UTF8_S) $(XMAL_S) $(GETFD_S) $(KDMA_S)
-mapscrn_SOURCES         = $(ALL_S) mapscrn.c $(FIND_S) $(UTF8_S) $(XMAL_S) $(GETFD_S) $(KDMA_S)
-openvt_SOURCES          = $(ALL_S) openvt.c $(GETFD_S) $(XMAL_S)
-psfxtable_SOURCES       = $(ALL_S) psfxtable.c $(PSF_S) $(XMAL_S) $(UTF8_S) $(GETFD_S)
-resizecons_SOURCES      = $(ALL_S) resizecons.c $(GETFD_S) $(FIND_S) $(XMAL_S)
-screendump_SOURCES      = $(ALL_S) screendump.c $(XMAL_S)
-setfont_SOURCES         = $(ALL_S) setfont.c $(FIND_S) $(XMAL_S) $(GETFD_S) mapscrn.c $(KDMA_S) $(PSF_S) $(UTF8_S) kdfontop.c kdfontop.h $(UNIM_S)
-setkeycodes_SOURCES     = $(ALL_S) setkeycodes.c $(GETFD_S)
-setvtrgb_SOURCES        = $(ALL_S) setvtrgb.c $(GETFD_S)
-setlogcons_SOURCES      = $(ALL_S) setlogcons.c $(GETFD_S)
-setpalette_SOURCES      = $(ALL_S) setpalette.c $(GETFD_S)
-setvesablank_SOURCES    = $(ALL_S) setvesablank.c $(GETFD_S)
-showconsolefont_SOURCES = $(ALL_S) showconsolefont.c $(GETFD_S) $(XMAL_S) $(KDMA_S) kdfontop.c kdfontop.h
-showkey_SOURCES         = $(ALL_S) showkey.c $(GETFD_S)
-kbdinfo_SOURCES         = $(ALL_S) kbdinfo.c $(GETFD_S)
+
+libcommon_a_SOURCES = \
+       getfd.c getfd.h \
+       xmalloc.c xmalloc.h
+
+libfont_a_SOURCES   = \
+       psf.h psffontop.c psffontop.h \
+       utf8.c utf8.h \
+       kdmapop.c kdmapop.h \
+       loadunimap.c loadunimap.h \
+       kdfontop.c kdfontop.h
+
+ALL_S   = nls.h paths.h version.h kbd.h
+
+chvt_SOURCES            = $(ALL_S) chvt.c
+clrunimap_SOURCES       = $(ALL_S) clrunimap.c
+deallocvt_SOURCES       = $(ALL_S) deallocvt.c
+fgconsole_SOURCES       = $(ALL_S) fgconsole.c
+getkeycodes_SOURCES     = $(ALL_S) getkeycodes.c
+getunimap_SOURCES       = $(ALL_S) getunimap.c
+kbd_mode_SOURCES        = $(ALL_S) kbd_mode.c
+loadunimap_SOURCES      = $(ALL_S) loadunimap.c
+mapscrn_SOURCES         = $(ALL_S) mapscrn.c
+openvt_SOURCES          = $(ALL_S) openvt.c
+psfxtable_SOURCES       = $(ALL_S) psfxtable.c
+resizecons_SOURCES      = $(ALL_S) resizecons.c
+screendump_SOURCES      = $(ALL_S) screendump.c
+setfont_SOURCES         = $(ALL_S) setfont.c mapscrn.c
+setkeycodes_SOURCES     = $(ALL_S) setkeycodes.c
+setvtrgb_SOURCES        = $(ALL_S) setvtrgb.c
+setlogcons_SOURCES      = $(ALL_S) setlogcons.c
+setpalette_SOURCES      = $(ALL_S) setpalette.c
+setvesablank_SOURCES    = $(ALL_S) setvesablank.c
+showconsolefont_SOURCES = $(ALL_S) showconsolefont.c
+showkey_SOURCES         = $(ALL_S) showkey.c
+kbdinfo_SOURCES         = $(ALL_S) kbdinfo.c
+
+dumpkeys_SOURCES        = $(ALL_S) dumpkeys.c
+loadkeys_SOURCES        = $(ALL_S) loadkeys.c
 
 mapscrn_CFLAGS = -DMAIN
 loadunimap_CFLAGS = -DMAIN
 
-AM_YFLAGS = -d
-BUILT_SOURCES = loadkeys.c loadkeys.analyze.c loadkeys.h
-loadkeys_SOURCES = loadkeys.y loadkeys.analyze.l $(GETFD_S) $(KSYMS_S) $(XMAL_S) $(FIND_S)
+noinst_LIBRARIES = libcommon.a libfont.a
+LDADD = libcommon.a libfont.a libkeymap/libkeymap.la
 
 install-exec-hook:
        for i in psfaddtable psfgettable psfstriptable; do \