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> 2012-01-15 Keith Marshall <keithmarshall@users.sf.net>
Update and correct makefile rebuilding rules. Update and correct makefile rebuilding rules.

View File

@ -43,6 +43,24 @@ WINDRES = @WINDRES@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
AR = @AR@ 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, # In spite of its general unsuitability for use on MS-Windows hosts,
# Cygwin is able to, and likes to support the $(DESTDIR) capability; # Cygwin is able to, and likes to support the $(DESTDIR) capability;
# provide a graceful rejection mechanism, for any (non-Cygwin) cases # provide a graceful rejection mechanism, for any (non-Cygwin) cases

View File

@ -19,29 +19,13 @@ VPATH = @srcdir@
include ${top_builddir}/Makefile.comm include ${top_builddir}/Makefile.comm
# Depending on if we build as part of winsup or mingw we need to INCLUDES = -I ${top_srcdir}/include $(EXTRA_INCLUDES)
# 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)
# Headers # Headers
# #
HEADERS = $(notdir $(wildcard ${srcdir}/../include/*.h)) HEADERS = $(notdir $(wildcard ${top_srcdir}/include/*.h))
GL_HEADERS = $(notdir $(wildcard ${srcdir}/../include/GL/*.h)) GL_HEADERS = $(notdir $(wildcard ${top_srcdir}/include/GL/*.h))
GDIPLUS_HEADERS = $(notdir $(wildcard ${srcdir}/../include/gdiplus/*.h)) GDIPLUS_HEADERS = $(notdir $(wildcard ${top_srcdir}/include/gdiplus/*.h))
# Libraries # Libraries
# #
@ -152,15 +136,15 @@ install-libraries: all $(need-DESTDIR-compatibility)
install-headers: $(need-DESTDIR-compatibility) install-headers: $(need-DESTDIR-compatibility)
$(mkinstalldirs) $(DESTDIR)${inst_includedir} $(mkinstalldirs) $(DESTDIR)${inst_includedir}
for file in $(HEADERS); do \ for file in $(HEADERS); do \
$(INSTALL_DATA) ${srcdir}/../include/$$file $(DESTDIR)${inst_includedir}; \ $(INSTALL_DATA) ${top_srcdir}/include/$$file $(DESTDIR)${inst_includedir}; \
done done
$(mkinstalldirs) $(DESTDIR)${inst_includedir}/GL $(mkinstalldirs) $(DESTDIR)${inst_includedir}/GL
for file in $(GL_HEADERS); do \ 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 done
$(mkinstalldirs) $(DESTDIR)${inst_includedir}/gdiplus $(mkinstalldirs) $(DESTDIR)${inst_includedir}/gdiplus
for file in $(GDIPLUS_HEADERS); do \ 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 done
install-ddk: install-libraries install-headers install-ddk: install-libraries install-headers
@ -195,15 +179,15 @@ dist:
mkdir ${distdir}/include mkdir ${distdir}/include
chmod 755 ${distdir}/include chmod 755 ${distdir}/include
for file in $(HEADERS); do \ for file in $(HEADERS); do \
cp -p ${srcdir}/../include/$$file ${distdir}/include; \ cp -p ${top_srcdir}/include/$$file ${distdir}/include; \
done done
mkdir ${distdir}/include/GL mkdir ${distdir}/include/GL
for file in $(GL_HEADERS); do \ 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 done
mkdir ${distdir}/include/gdiplus mkdir ${distdir}/include/gdiplus
for file in $(GDIPLUS_HEADERS); do \ 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 done
mkdir ${distdir}/lib mkdir ${distdir}/lib
chmod 755 ${distdir}/lib chmod 755 ${distdir}/lib

View File

@ -16,28 +16,11 @@ top_builddir = @top_builddir@
VPATH = @srcdir@ VPATH = @srcdir@
include ${top_builddir}/Makefile.comm include ${top_builddir}/Makefile.comm
INCLUDES = -I ${top_srcdir}/include $(EXTRA_INCLUDES)
# 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)
# Headers # Headers
# #
HEADERS = $(notdir $(wildcard ${srcdir}/../../include/ddk/*.h)) HEADERS = $(notdir $(wildcard ${top_srcdir}/include/ddk/*.h))
# Libraries # Libraries
# #
@ -91,7 +74,7 @@ ddk_includedir = ${inst_includedir}/ddk
install-headers: $(need-DESTDIR-compatibility) install-headers: $(need-DESTDIR-compatibility)
$(mkinstalldirs) $(DESTDIR)${ddk_includedir} $(mkinstalldirs) $(DESTDIR)${ddk_includedir}
for file in $(HEADERS); do \ 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 done
# Uninstall headers and libraries from a target specified directory # Uninstall headers and libraries from a target specified directory
@ -114,7 +97,7 @@ dist:
mkdir ${distdir}/include/ddk mkdir ${distdir}/include/ddk
chmod 755 ${distdir}/include/ddk chmod 755 ${distdir}/include/ddk
for file in $(HEADERS); do \ 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 done
mkdir ${distdir}/lib/ddk mkdir ${distdir}/lib/ddk
chmod 755 ${distdir}/lib/ddk chmod 755 ${distdir}/lib/ddk

View File

@ -16,31 +16,12 @@ top_builddir = @top_builddir@
VPATH = @srcdir@ VPATH = @srcdir@
include ${top_builddir}/Makefile.comm include ${top_builddir}/Makefile.comm
INCLUDES = -I ${top_srcdir}/include -I ${top_srcdir}/include/directx \
# 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 \
$(EXTRA_INCLUDES) $(EXTRA_INCLUDES)
# Headers # Headers
# #
HEADERS = $(notdir $(wildcard ${srcdir}/../../include/directx/*.h)) HEADERS = $(notdir $(wildcard ${top_srcdir}/include/directx/*.h))
# Libraries # Libraries
# #
@ -70,7 +51,7 @@ all-default: $(LIBS)
TEST_OPTIONS = \ TEST_OPTIONS = \
$(ALL_CFLAGS) -Wall -pedantic -Wsystem-headers \ $(ALL_CFLAGS) -Wall -pedantic -Wsystem-headers \
-c $(srcdir)/test.c -o test.o -c ${srcdir}/test.c -o test.o
.PHONY: test .PHONY: test
test: test:
@echo "Testing directx..." @echo "Testing directx..."
@ -119,7 +100,7 @@ install-libraries: all $(need-DESTDIR-compatibility)
install-headers: $(need-DESTDIR-compatibility) install-headers: $(need-DESTDIR-compatibility)
$(mkinstalldirs) $(DESTDIR)${inst_includedir} $(mkinstalldirs) $(DESTDIR)${inst_includedir}
for file in $(HEADERS); do \ 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 done
# Uninstall headers and libraries from a target specified directory # Uninstall headers and libraries from a target specified directory
@ -142,7 +123,7 @@ dist:
mkdir ${distdir}/include/directx mkdir ${distdir}/include/directx
chmod 755 ${distdir}/include/directx chmod 755 ${distdir}/include/directx
for file in $(HEADERS); do \ 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 done
mkdir ${distdir}/lib/directx mkdir ${distdir}/lib/directx
chmod 755 ${distdir}/lib/directx chmod 755 ${distdir}/lib/directx