[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tyndur-devel] Makefile Patches



build: ein Makefile.local reicht

* buildmk.sh generiert nur noch ein Makefile.local für alle Makefiles

Signed-off-by: Andreas Freimuth <m.nemo@xxxxxxx>
Signed-off-by: Jörg Pfähler <bluecoder@xxxxxx>

diff --git a/buildmk.sh b/buildmk.sh
--- a/buildmk.sh
+++ b/buildmk.sh
@@ -82,20 +82,29 @@ if [ -f Makefile.conf ]; then
     source Makefile.conf
 fi
 
-cat <<EOF > Makefile.local
+if [ "$LOST_BUILDMK_ROOT" == "`pwd`" ]; then
+  cat <<EOF > Makefile.local
 BUILD_ROOT=$LOST_BUILDMK_ROOT/build/output
 PPC_BINARY=$LOST_TOOLS_PPC
 EOF
 
-# Ist grub legacy installiert?
-if [ -f $GRUB_STAGEDIR/stage1 ]; then
-  echo GRUB_VERSION=grub1 >> Makefile.local
-else
-  echo GRUB_VERSION=grub2 >> Makefile.local
+  # Ist grub legacy installiert?
+  if [ -f $GRUB_STAGEDIR/stage1 ]; then
+    echo GRUB_VERSION=grub1 >> Makefile.local
+  else
+    echo GRUB_VERSION=grub2 >> Makefile.local
+  fi
 fi
 
-cat <<EOF > Makefile
--include Makefile.local
+# Nur die Unterverzeichnisse nutzen den absoluten Pfad zu Makefile.local, um
+# Ã?nderungen am Makefile im Wurzelverzeichnis zu verhindern
+if [ "$LOST_BUILDMK_ROOT" == "`pwd`" ]; then
+  echo "-include Makefile.local" > Makefile
+else
+  echo "-include $LOST_BUILDMK_ROOT/Makefile.local" > Makefile
+fi
+
+cat <<EOF >> Makefile
 
 CC=$LOST_TOOLS_GCC $CC_FLAGS $INCLUDES $CC_FLAGS_APPEND
 CPP=$LOST_TOOLS_GPP $INCLUDES
@@ -136,13 +145,13 @@ makefiles:
 
 EOF
 
-# Wenn eine .nobuildfiles mit eintraegen fuer alle Dateien die nicht gebaut
+# Wenn eine .nobuildfiles mit eintraegen für alle Dateien die nicht gebaut
 # werden sollen exisitiert, wird diese eingelesen
 NOBUILDFILES=
 if [ -f .nobuildfiles ]; then NOBUILDFILES="`cat .nobuildfiles`"; fi
 
 # Dateien zusammensuchen,die im aktuellen Verzeichnis
-# kompiliert werden müssen
+# kompiliert werden müssen
 FILES=
 for file in *.c *.cpp *.asm *.pas *.S; do
   if [ "`echo \"$NOBUILDFILES\" | grep -e ^$file\$`" ]; then continue; fi
@@ -234,7 +243,7 @@ for file in *.c *.cpp *.asm *.pas *.S; d
   fi
 done
 
-# Code für lbuilds
+# Code für lbuilds
 cat <<EOF >> Makefile
 
 .PHONY: lbuilds-env
@@ -252,7 +261,7 @@ disable-pascal:
 	rm -f src/modules/pas/.ignorenobuild
 EOF
 
-# Code für make clean
+# Code für make clean
 cat <<EOF >> Makefile
 
 clean_objs:
Makefile: lbuilds-env und *-pascal targets nur im Hauptmakefile

* lbuilds-env, enable- und disable-pascal Targets werden in den
  Untermakefiles nicht gebraucht

Signed-off-by: Andreas Freimuth <m.nemo@xxxxxxx>

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -25,8 +25,20 @@ subdirs:
 	$(MAKE) --no-print-directory -sC doc
 	$(MAKE) --no-print-directory -sC src
 
+clean_objs:
+	rm -f *.o *.a *.mod *.ppu link.res ppas.sh repo.hg
+
+softclean: clean_objs
+	for file in *; do if [ -f "$$file/Makefile" -a \( ! -f "$$file/.nobuild" -o -f "$$file/.ignorenobuild" \) ]; then $(MAKE) -sC "$$file" softclean; fi done
+
+clean: clean_objs
+	for file in *; do if [ -f "$$file/Makefile" -a \( ! -f "$$file/.nobuild" -o -f "$$file/.ignorenobuild" \) ]; then $(MAKE) -sC "$$file" clean; rm "$$file/Makefile"; fi done
+	rm -f Makefile.local
+
+.SILENT: all makefiles subdirs obj lbuilds-env enable-pascal disable-pascal clean softclean clean_objs clean_root updateroot image-floppy image-hd test-qemu test-qemu-hd
 .PHONY: lbuilds-env
 
+# Code für lbuilds
 lbuilds-env:
 	if [ -d lbuilds ]; then cd lbuilds && git pull; else git clone git://git.tyndur.org/lbuilds.git lbuilds; fi
 	touch lbuilds/.nobuild
@@ -39,17 +51,6 @@ enable-pascal:
 disable-pascal:
 	rm -f src/modules/pas/.ignorenobuild
 
-clean_objs:
-	rm -f *.o *.a *.mod *.ppu link.res ppas.sh tyndur
-
-softclean: clean_objs
-	for file in *; do if [ -f "$$file/Makefile" -a \( ! -f "$$file/.nobuild" -o -f "$$file/.ignorenobuild" \) ]; then $(MAKE) -sC "$$file" softclean; fi done
-
-clean: clean_objs
-	for file in *; do if [ -f "$$file/Makefile" -a \( ! -f "$$file/.nobuild" -o -f "$$file/.ignorenobuild" \) ]; then $(MAKE) -sC "$$file" clean; rm "$$file/Makefile"; fi done
-	rm -f Makefile.local
-
-.SILENT: all makefiles subdirs obj lbuilds-env enable-pascal disable-pascal clean softclean clean_objs clean_root updateroot image-floppy image-hd test-qemu test-qemu-hd
 clean: clean_root
 
 clean_root:
diff --git a/buildmk.sh b/buildmk.sh
--- a/buildmk.sh
+++ b/buildmk.sh
@@ -243,24 +243,6 @@ for file in *.c *.cpp *.asm *.pas *.S; d
   fi
 done
 
-# Code für lbuilds
-cat <<EOF >> Makefile
-
-.PHONY: lbuilds-env
-
-lbuilds-env:
-	if [ -d lbuilds ]; then cd lbuilds && git pull; else git clone git://git.tyndur.org/lbuilds.git lbuilds; fi
-	touch lbuilds/.nobuild
-	cd lbuilds && scripts/build_crosstools && scripts/update_env \`dirname \\\`pwd\\\`\` && ln -sf \`pwd\`/tmp/cross-fpc/fpc-2.4.0/rtl/ \`dirname \\\`pwd\\\`\`/src/modules/pas/lib/rtl/include
-	make enable-pascal
-
-enable-pascal:
-	touch src/modules/pas/.ignorenobuild
-
-disable-pascal:
-	rm -f src/modules/pas/.ignorenobuild
-EOF
-
 # Code für make clean
 cat <<EOF >> Makefile
 
@@ -279,6 +261,21 @@ EOF
 
 if [ "$LOST_BUILDMK_ROOT" == "`pwd`" ]; then
 cat <<EOF >> Makefile
+.PHONY: lbuilds-env
+
+# Code für lbuilds
+lbuilds-env:
+	if [ -d lbuilds ]; then cd lbuilds && git pull; else git clone git://git.tyndur.org/lbuilds.git lbuilds; fi
+	touch lbuilds/.nobuild
+	cd lbuilds && scripts/build_crosstools && scripts/update_env \`dirname \\\`pwd\\\`\` && ln -sf \`pwd\`/tmp/cross-fpc/fpc-2.4.0/rtl/ \`dirname \\\`pwd\\\`\`/src/modules/pas/lib/rtl/include
+	make enable-pascal
+
+enable-pascal:
+	touch src/modules/pas/.ignorenobuild
+
+disable-pascal:
+	rm -f src/modules/pas/.ignorenobuild
+
 clean: clean_root
 
 clean_root: