More makefile code refactoring; fix top_srcdir references.

This commit is contained in:
Keith Marshall 2012-01-15 15:31:11 +00:00
parent 6208cfce7a
commit f485d8ffb4
5 changed files with 51 additions and 71 deletions

View File

@ -1,3 +1,17 @@
2012-01-15 Keith Marshall <keithmarshall@users.sf.net>
More makefile code refactoring; fix top_srcdir references.
* Makefile.comm.in (EXTRA_INCLUDES): Add definitions from...
* lib/Makefile.in (EXTRA_INCLUDES): ...here; factor out common code.
(top_srcdir): Use this throughout, in place of ${srcdir}/../
* lib/ddk/Makefile.in lib/directx/Makefile.in (EXTRA_INCLUDES):
Factor out; use corrected definitions from Makefile.comm.in
(top_srcdir): Use throughout, in place of ${srcdir}/../../
(INCLUDES): Adjust incorrect references to ${srcdir}/../include;
should be ${top_srcdir}/include
2012-01-15 Keith Marshall <keithmarshall@users.sf.net>
Update and correct makefile rebuilding rules.

View File

@ -43,6 +43,24 @@ WINDRES = @WINDRES@
RANLIB = @RANLIB@
AR = @AR@
# Depending on if we build as part of winsup or mingw we need to
# add additional include paths in order to get the correct headers
# from the C library.
#
BUILDENV = @BUILDENV@
ifeq ($(BUILDENV), cygwin)
# winsup/include
# winsup/../newlib/libc/include
# winsup/../newlib/libc/sys/cygwin
EXTRA_INCLUDES = -I ${top_srcdir}/../include \
-I ${top_srcdir}/../../newlib/libc/include \
-I ${top_srcdir}/../../newlib/libc/sys/cygwin
endif
ifeq ($(BUILDENV), mingw)
EXTRA_INCLUDES = -I ${top_srcdir}/../mingw/include
endif
# In spite of its general unsuitability for use on MS-Windows hosts,
# Cygwin is able to, and likes to support the $(DESTDIR) capability;
# provide a graceful rejection mechanism, for any (non-Cygwin) cases

View File

@ -19,29 +19,13 @@ VPATH = @srcdir@
include ${top_builddir}/Makefile.comm
# Depending on if we build as part of winsup or mingw we need to
# add additional include paths in order to get the correct headers
# from the C library.
#
BUILDENV = @BUILDENV@
ifeq ($(BUILDENV), cygwin)
# winsup/include
# winsup/../newlib/libc/include
# winsup/../newlib/libc/sys/cygwin
EXTRA_INCLUDES = -I${srcdir}/../../include -I${srcdir}/../../../newlib/libc/include -I${srcdir}/../../../newlib/libc/sys/cygwin
endif
ifeq ($(BUILDENV), mingw)
EXTRA_INCLUDES = -I${srcdir}/../../mingw/include
endif
INCLUDES = -I${srcdir}/../include $(EXTRA_INCLUDES)
INCLUDES = -I ${top_srcdir}/include $(EXTRA_INCLUDES)
# Headers
#
HEADERS = $(notdir $(wildcard ${srcdir}/../include/*.h))
GL_HEADERS = $(notdir $(wildcard ${srcdir}/../include/GL/*.h))
GDIPLUS_HEADERS = $(notdir $(wildcard ${srcdir}/../include/gdiplus/*.h))
HEADERS = $(notdir $(wildcard ${top_srcdir}/include/*.h))
GL_HEADERS = $(notdir $(wildcard ${top_srcdir}/include/GL/*.h))
GDIPLUS_HEADERS = $(notdir $(wildcard ${top_srcdir}/include/gdiplus/*.h))
# Libraries
#
@ -152,15 +136,15 @@ install-libraries: all $(need-DESTDIR-compatibility)
install-headers: $(need-DESTDIR-compatibility)
$(mkinstalldirs) $(DESTDIR)${inst_includedir}
for file in $(HEADERS); do \
$(INSTALL_DATA) ${srcdir}/../include/$$file $(DESTDIR)${inst_includedir}; \
$(INSTALL_DATA) ${top_srcdir}/include/$$file $(DESTDIR)${inst_includedir}; \
done
$(mkinstalldirs) $(DESTDIR)${inst_includedir}/GL
for file in $(GL_HEADERS); do \
$(INSTALL_DATA) ${srcdir}/../include/GL/$$file $(DESTDIR)${inst_includedir}/GL; \
$(INSTALL_DATA) ${top_srcdir}/include/GL/$$file $(DESTDIR)${inst_includedir}/GL; \
done
$(mkinstalldirs) $(DESTDIR)${inst_includedir}/gdiplus
for file in $(GDIPLUS_HEADERS); do \
$(INSTALL_DATA) ${srcdir}/../include/gdiplus/$$file $(DESTDIR)${inst_includedir}/gdiplus; \
$(INSTALL_DATA) ${top_srcdir}/include/gdiplus/$$file $(DESTDIR)${inst_includedir}/gdiplus; \
done
install-ddk: install-libraries install-headers
@ -195,15 +179,15 @@ dist:
mkdir ${distdir}/include
chmod 755 ${distdir}/include
for file in $(HEADERS); do \
cp -p ${srcdir}/../include/$$file ${distdir}/include; \
cp -p ${top_srcdir}/include/$$file ${distdir}/include; \
done
mkdir ${distdir}/include/GL
for file in $(GL_HEADERS); do \
cp -p ${srcdir}/../include/GL/$$file ${distdir}/include/GL; \
cp -p ${top_srcdir}/include/GL/$$file ${distdir}/include/GL; \
done
mkdir ${distdir}/include/gdiplus
for file in $(GDIPLUS_HEADERS); do \
cp -p ${srcdir}/../include/gdiplus/$$file ${distdir}/include/gdiplus; \
cp -p ${top_srcdir}/include/gdiplus/$$file ${distdir}/include/gdiplus; \
done
mkdir ${distdir}/lib
chmod 755 ${distdir}/lib

View File

@ -16,28 +16,11 @@ top_builddir = @top_builddir@
VPATH = @srcdir@
include ${top_builddir}/Makefile.comm
# Depending on if we build as part of winsup or mingw we need to
# add additional include paths in order to get the correct headers
# from the C library.
#
BUILDENV = @BUILDENV@
ifeq ($(BUILDENV), cygwin)
# winsup/include
# winsup/../newlib/libc/include
# winsup/../newlib/libc/sys/cygwin
EXTRA_INCLUDES = -I${srcdir}/../../include -I${srcdir}/../../../newlib/libc/include -I${srcdir}/../../../newlib/libc/sys/cygwin
endif
ifeq ($(BUILDENV), mingw)
EXTRA_INCLUDES = -I${srcdir}/../../mingw/include
endif
INCLUDES = -I${srcdir}/../include $(EXTRA_INCLUDES)
INCLUDES = -I ${top_srcdir}/include $(EXTRA_INCLUDES)
# Headers
#
HEADERS = $(notdir $(wildcard ${srcdir}/../../include/ddk/*.h))
HEADERS = $(notdir $(wildcard ${top_srcdir}/include/ddk/*.h))
# Libraries
#
@ -91,7 +74,7 @@ ddk_includedir = ${inst_includedir}/ddk
install-headers: $(need-DESTDIR-compatibility)
$(mkinstalldirs) $(DESTDIR)${ddk_includedir}
for file in $(HEADERS); do \
$(INSTALL_DATA) ${srcdir}/../../include/ddk/$$file $(DESTDIR)${ddk_includedir}; \
$(INSTALL_DATA) ${top_srcdir}/include/ddk/$$file $(DESTDIR)${ddk_includedir}; \
done
# Uninstall headers and libraries from a target specified directory
@ -114,7 +97,7 @@ dist:
mkdir ${distdir}/include/ddk
chmod 755 ${distdir}/include/ddk
for file in $(HEADERS); do \
cp -p ${srcdir}/../../include/ddk/$$file ${distdir}/include/ddk; \
cp -p ${top_srcdir}/include/ddk/$$file ${distdir}/include/ddk; \
done
mkdir ${distdir}/lib/ddk
chmod 755 ${distdir}/lib/ddk

View File

@ -16,31 +16,12 @@ top_builddir = @top_builddir@
VPATH = @srcdir@
include ${top_builddir}/Makefile.comm
# Depending on if we build as part of winsup or mingw we need to
# add additional include paths in order to get the correct headers
# from the C library.
#
BUILDENV = @BUILDENV@
ifeq ($(BUILDENV), cygwin)
# winsup/include
# winsup/../newlib/libc/include
# winsup/../newlib/libc/sys/cygwin
EXTRA_INCLUDES = -I ${srcdir}/../../include \
-I ${srcdir}/../../../newlib/libc/include \
-I ${srcdir}/../../../newlib/libc/sys/cygwin
endif
ifeq ($(BUILDENV), mingw)
EXTRA_INCLUDES = -I ${srcdir}/../../mingw/include
endif
INCLUDES = -I ${srcdir}/../include -I ${srcdir}/../include/directx \
INCLUDES = -I ${top_srcdir}/include -I ${top_srcdir}/include/directx \
$(EXTRA_INCLUDES)
# Headers
#
HEADERS = $(notdir $(wildcard ${srcdir}/../../include/directx/*.h))
HEADERS = $(notdir $(wildcard ${top_srcdir}/include/directx/*.h))
# Libraries
#
@ -70,7 +51,7 @@ all-default: $(LIBS)
TEST_OPTIONS = \
$(ALL_CFLAGS) -Wall -pedantic -Wsystem-headers \
-c $(srcdir)/test.c -o test.o
-c ${srcdir}/test.c -o test.o
.PHONY: test
test:
@echo "Testing directx..."
@ -119,7 +100,7 @@ install-libraries: all $(need-DESTDIR-compatibility)
install-headers: $(need-DESTDIR-compatibility)
$(mkinstalldirs) $(DESTDIR)${inst_includedir}
for file in $(HEADERS); do \
$(INSTALL_DATA) ${srcdir}/../../include/directx/$$file $(DESTDIR)${inst_includedir}; \
$(INSTALL_DATA) ${top_srcdir}/include/directx/$$file $(DESTDIR)${inst_includedir}; \
done
# Uninstall headers and libraries from a target specified directory
@ -142,7 +123,7 @@ dist:
mkdir ${distdir}/include/directx
chmod 755 ${distdir}/include/directx
for file in $(HEADERS); do \
cp -p ${srcdir}/../../include/directx/$$file ${distdir}/include/directx; \
cp -p ${top_srcdir}/include/directx/$$file ${distdir}/include/directx; \
done
mkdir ${distdir}/lib/directx
chmod 755 ${distdir}/lib/directx