[1900] 2008-11-08 Robert Millan <[email protected]>

Robert Millan <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 1900
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=1900
Author:   robertmh
Date:     2008-11-08 11:29:53 +0000 (Sat, 08 Nov 2008)

Log Message:
-----------
2008-11-08  Robert Millan  <[email protected]>

        * Makefile.in (PKGLIB): Add $(pkglib_BUILDDIR).
        (PKGDATA): Add $(pkgdata_SRCDIR).
        (pkglib_BUILDDIR): New variable.
        (pkgdata_SRCDIR): New variable.
        (build_env.mk): New target.
        (include_DATA): New variable.
        (install-local): Install $(include_DATA) files in $(includedir).

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/Makefile.in

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2008-11-07 22:33:37 UTC (rev 1899)
+++ trunk/grub2/ChangeLog	2008-11-08 11:29:53 UTC (rev 1900)
@@ -1,3 +1,13 @@
+2008-11-08  Robert Millan  <[email protected]>
+
+	* Makefile.in (PKGLIB): Add $(pkglib_BUILDDIR).
+	(PKGDATA): Add $(pkgdata_SRCDIR).
+	(pkglib_BUILDDIR): New variable.
+	(pkgdata_SRCDIR): New variable.
+	(build_env.mk): New target.
+	(include_DATA): New variable.
+	(install-local): Install $(include_DATA) files in $(includedir).
+
 2008-11-07  Pavel Roskin  <[email protected]>
 
 	* gendistlist.sh: Use C locale for sorting to ensure consistent

Modified: trunk/grub2/Makefile.in
===================================================================
--- trunk/grub2/Makefile.in	2008-11-07 22:33:37 UTC (rev 1899)
+++ trunk/grub2/Makefile.in	2008-11-08 11:29:53 UTC (rev 1900)
@@ -105,8 +105,8 @@
 MKFILES = $(patsubst %.rmk,%.mk,$(RMKFILES))
 
 PKGLIB = $(pkglib_IMAGES) $(pkglib_MODULES) $(pkglib_PROGRAMS) \
-	$(pkglib_DATA) $(lib_DATA)
-PKGDATA = $(pkgdata_DATA)
+	$(pkglib_DATA) $(lib_DATA) $(pkglib_BUILDDIR)
+PKGDATA = $(pkgdata_DATA) $(pkgdata_SRCDIR)
 PROGRAMS = $(bin_UTILITIES) $(sbin_UTILITIES)
 SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) $(grub-mkconfig_SCRIPTS)
 
@@ -163,6 +163,22 @@
 	ruby $(srcdir)/util/unifont2pff.rb 0x0-0x7f $(UNICODE_ARROWS) $(UNICODE_LINES) $(UNIFONT_HEX) > $@
 endif
 
+# Used for building modules externally
+pkglib_BUILDDIR += build_env.mk
+build_env.mk: Makefile
+	(\
+	echo "TARGET_CC=$(TARGET_CC)" ; \
+	echo "TARGET_CFLAGS=$(TARGET_CFLAGS)" ; \
+	echo "TARGET_CPPFLAGS=$(TARGET_CPPFLAGS) -I$(pkglibdir)" ; \
+	echo "STRIP=$(STRIP)" ; \
+	echo "COMMON_ASFLAGS=$(COMMON_ASFLAGS)" ; \
+	echo "COMMON_CFLAGS=$(COMMON_CFLAGS)" ; \
+	echo "COMMON_LDFLAGS=$(COMMON_LDFLAGS)"\
+	) > $@
+pkglib_BUILDDIR += config.h grub_script.tab.h
+pkgdata_SRCDIR += genmodsrc.sh genmk.rb
+include_DATA += $(shell find include -name \*.h) include/grub/cpu
+
 all-local: $(PROGRAMS) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(MKFILES)
 
 install: install-local
@@ -175,6 +191,19 @@
 	  dest="`echo $$file | sed 's,.*/,,'`"; \
 	  $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkglibdir)/$$dest; \
 	done
+	$(mkinstalldirs) $(DESTDIR)$(includedir)
+	@list='$(include_DATA)'; \
+	for file in $$list; do \
+	  if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
+	  dest="`echo $$file | sed 's,include/,,'`"; \
+	  destdir="`echo $$dest | sed 's,\(^\|/\)[^/]*$$,,g'`"; \
+	  $(mkinstalldirs) $(DESTDIR)$(includedir)/$$destdir; \
+	  if test -f "$$dir$$file"; then \
+	    $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(includedir)/$$dest; \
+	  elif test -L "$$dir$$file"; then \
+	    cp -d $$dir$$file $(DESTDIR)$(includedir)/$$dest; \
+	  fi; \
+	done
 	$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
 	@list='$(PKGDATA)'; \
 	for file in $$list; do \
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.