OSDN Git Service

Make <vptype.h> header effectively self-contained.
[mingw/mingw-org-wsl.git] / w32api / Makefile.in
index 0737012..7aecd01 100644 (file)
@@ -1,13 +1,13 @@
 # @configure_input@
 # $Id$
 #
-# Makefile template for MinGW.org MS-Windows API Package
+# Makefile template for MinGW.OSDN MS-Windows API Package
 
 PACKAGE_TARNAME := @PACKAGE_TARNAME@
 PACKAGE_VERSION := @PACKAGE_VERSION@
 
-# Written by Keith Marshall <keithmarshall@users.sourceforge.net>
-# Copyright (C) 2014-2017, MinGW.org Project
+# Written by Keith Marshall <keith@users.osdn.me>
+# Copyright (C) 2014-2017, 2021, 2022, MinGW.OSDN Project
 #
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -80,59 +80,13 @@ INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@ $1 $2
 LN_S = @LN_S@
 
-# Keep the configuration in a consistent state.  Note that we assume
-# that configure has been run initially, (otherwise we wouldn't have
-# a Makefile to begin with); since this also creates config.status,
-# we may normally assume that it is already available ...
+# Include the makefile content which is common to both the mingwrt,
+# and the w32api packages; this may be included within the top level
+# source directory for each package individually, but we must also
+# be prepared to find it in their common parent directory.
 #
-vpath configure ${top_srcdir}
-config.status: configure
-       $(SHELL) config.status --recheck
-
-# ... in which case, updating Makefile should be a simple matter of
-# running config.status ...
-#
-vpath Makefile.in ${top_srcdir}
-requires_existing = $(if $(wildcard $1),$1,$1.missing)
-Makefile: Makefile.in configure $(call requires_existing,config.status)
-       $(SHELL) config.status
-
-.PHONY: config.status.missing
-# ... but, in the event that this may be missing, (e.g. because it
-# has been manually removed, or removed by "make distclean"), suggest
-# running configure, and bail out.
-#
-config.status.missing:
-       $(warning *** cannot execute config.status)
-       $(error please run ${top_srcdir}/configure to regenerate it.)
-
-# If configure itself needs to be updated, we must run autoconf in the
-# top level source directory.
-#
-vpath configure.ac ${top_srcdir}
-vpath %.m4 ${top_srcdir}/.. ${top_srcdir}
-configure: configure.ac aclocal.m4 VERSION.m4
-       cd ${top_srcdir}; autoconf -I ..
-
-# Propagate package version, as configured, consistently throughout
-# the package build.
-#
-vpath %.h.in ${top_srcdir}/include ${mingwrt_srcdir}/include
-
-w32api.h _mingw.h: configure.ac
-
-PACKAGE_VERSION_SCRIPT = sed \
-  -e s"`$(call PACKAGE_VERSION_FORMAT,LONG,%d,$$3+1000*($$2+1000*$$1))`" \
-  -e s"`$(call PACKAGE_VERSION_FORMAT,MAJOR,%7d,$$1)`" \
-  -e s"`$(call PACKAGE_VERSION_FORMAT,MINOR,%7d,$$2)`" \
-  -e s"`$(call PACKAGE_VERSION_FORMAT,PATCH,%7d,$$3)`"
-
-PACKAGE_VERSION_FORMAT = echo $(PACKAGE_VERSION).0.0 | awk -F. '{ \
-  printf ",%%PACKAGE_VERSION_$1%%,$2,", $3; \
-}'
-
-w32api.h _mingw.h: %.h: %.h.in
-       $(PACKAGE_VERSION_SCRIPT) $< > $@
+shared_include_file = $1$(if $(wildcard $1/$2),,/..)/$2
+include $(call shared_include_file,${top_srcdir},Makefile.comm)
 
 # Capture dependencies conveyed within source files, ensuring that
 # header files are taken from our working source tree, and not from
@@ -171,6 +125,16 @@ lib%.a: %.def
        $(if $(filter-out $<,$^),$(AR) $(ARFLAGS) $@ $(filter-out $<,$^))
 
 vpath %.c ${srcdir}/lib
+libkernel32.a: $(addsuffix .$(OBJEXT),k32entry bound osvercmp)
+
+NO_ALIGN_FLAGS := -fno-align-jumps -fno-align-functions
+bound.$(OBJEXT) unbound.$(OBJEXT): %.$(OBJEXT): availapi.c
+       $(CC) -c $(ALL_CFLAGS) $(NO_ALIGN_FLAGS) -D_$* $< -o $@
+
+bound_dll_api_list := k32entry
+$(addsuffix .$(OBJEXT),$(bound_dll_api_list)): %.$(OBJEXT): availapi.c
+       $(CC) -c $(ALL_CFLAGS) $(NO_ALIGN_FLAGS) -D_bound -D_lib=$* $< -o $@
+
 libuuid.a: ativscp-uuid.$(OBJEXT) cguid-uuid.$(OBJEXT)
 libuuid.a: comcat-uuid.$(OBJEXT) devguid.$(OBJEXT) docobj-uuid.$(OBJEXT)
 libuuid.a: exdisp-uuid.$(OBJEXT) extras-uuid.$(OBJEXT) hlguids-uuid.$(OBJEXT)
@@ -317,6 +281,16 @@ uninstall-w32api-libs: un%:
        $(MAKE) --no-print-directory mkinstalldirs= \
          INSTALL_DATA='cd $$2 && rm -f $$1' $*
 
+
+# Test Suite
+# ----------
+#
+.PHONY: check-recursive
+check test tests: check-recursive
+check-recursive:
+       $(MAKE) -C tests $@
+
+
 # Distribution
 # ------------
 #
@@ -345,17 +319,19 @@ mingwrt-srcdist w32api-srcdist: %-srcdist: %-srcdist-dir %-srcdist-files
          xz -c > $*-$(PACKAGE_RELEASE_TAG)-src.tar.xz
        $(RM) -r dist/$*-$(PACKAGE_VERSION)
 
+w32api-srcdist-testsuite-files: $(wildcard ${w32api_srcdir}/tests/*.at)
+w32api-srcdist-testsuite-files: $(wildcard ${w32api_srcdir}/tests/*.in)
+       (cd ${w32api_srcdir} && tar chf - $(addprefix tests/,$(notdir $^))) | \
+         (cd dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) && tar xf -)
+
 mingwrt-srcdist-dir w32api-srcdist-dir: %-srcdist-dir:
        $(RM) -r dist/$*-$(PACKAGE_VERSION)
        $(call mkinstalldirs,,dist/$*-$(PACKAGE_VERSION))
 
-w32api-srcdist-files: w32api-srcdist-config-files
+w32api-srcdist-files: w32api-srcdist-common-files
+w32api-srcdist-files: w32api-srcdist-testsuite-files
 w32api-srcdist-files: w32api-srcdist-package-files
 
-vpath install-sh ${top_srcdir}/.. ${top_srcdir}
-%-srcdist-config-files: aclocal.m4 VERSION.m4 install-sh
-         cp -p $^ dist/$*-$(PACKAGE_VERSION)
-
 %-srcdist-package-files:
        (cd ${$*_srcdir} && tar chf - --hard-dereference $(notdir $^)) | \
          (cd dist/$*-$(PACKAGE_VERSION) && tar xf -)
@@ -379,7 +355,7 @@ mostlyclean-local:
        $(RM) *.d *.$(OBJEXT)
 
 distclean-local: clean-local
-       $(RM) config.log config.status
+       $(RM) config.log config.status _mingw.h w32api.h
 
 maintainer-clean-warning:
        $(warning $(MAKE) $(@:%-warning=%))