Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Nov 2013 05:44:45 +0000 (UTC)
From:      Li-Wen Hsu <lwhsu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r258701 - in user/glebius/course: . 01.intro 02.entering_kernel 03.processes&threads 04.synchronisation 05.memory 06.filedesc 07.io 08.io2
Message-ID:  <201311280544.rAS5ijj9090352@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: lwhsu (ports committer)
Date: Thu Nov 28 05:44:44 2013
New Revision: 258701
URL: http://svnweb.freebsd.org/changeset/base/258701

Log:
  - Use for-loop to reduce duplicated code
  - Use dependency instead of directly invoking make on other target
  
  Approved by:	glebius

Modified:
  user/glebius/course/01.intro/Makefile
  user/glebius/course/02.entering_kernel/Makefile
  user/glebius/course/03.processes&threads/Makefile
  user/glebius/course/04.synchronisation/Makefile
  user/glebius/course/05.memory/Makefile
  user/glebius/course/06.filedesc/Makefile
  user/glebius/course/07.io/Makefile
  user/glebius/course/08.io2/Makefile
  user/glebius/course/Makefile

Modified: user/glebius/course/01.intro/Makefile
==============================================================================
--- user/glebius/course/01.intro/Makefile	Wed Nov 27 23:26:54 2013	(r258700)
+++ user/glebius/course/01.intro/Makefile	Thu Nov 28 05:44:44 2013	(r258701)
@@ -12,6 +12,5 @@ TMP=	$(NAME).aux $(NAME).log $(NAME).nav
 clean:
 	rm -f -- $(TMP) texput.log
 
-cleanall:
-	make clean
+cleanall: clean
 	rm -f $(NAME).pdf

Modified: user/glebius/course/02.entering_kernel/Makefile
==============================================================================
--- user/glebius/course/02.entering_kernel/Makefile	Wed Nov 27 23:26:54 2013	(r258700)
+++ user/glebius/course/02.entering_kernel/Makefile	Thu Nov 28 05:44:44 2013	(r258701)
@@ -12,6 +12,5 @@ TMP=	$(NAME).aux $(NAME).log $(NAME).nav
 clean:
 	rm -f -- $(TMP) texput.log
 
-cleanall:
-	make clean
+cleanall: clean
 	rm -f $(NAME).pdf

Modified: user/glebius/course/03.processes&threads/Makefile
==============================================================================
--- user/glebius/course/03.processes&threads/Makefile	Wed Nov 27 23:26:54 2013	(r258700)
+++ user/glebius/course/03.processes&threads/Makefile	Thu Nov 28 05:44:44 2013	(r258701)
@@ -12,6 +12,5 @@ TMP=	$(NAME).aux $(NAME).log $(NAME).nav
 clean:
 	rm -f -- $(TMP) texput.log
 
-cleanall:
-	make clean
+cleanall: clean
 	rm -f $(NAME).pdf

Modified: user/glebius/course/04.synchronisation/Makefile
==============================================================================
--- user/glebius/course/04.synchronisation/Makefile	Wed Nov 27 23:26:54 2013	(r258700)
+++ user/glebius/course/04.synchronisation/Makefile	Thu Nov 28 05:44:44 2013	(r258701)
@@ -12,6 +12,5 @@ TMP=	$(NAME).aux $(NAME).log $(NAME).nav
 clean:
 	rm -f -- $(TMP) texput.log
 
-cleanall:
-	make clean
+cleanall: clean
 	rm -f $(NAME).pdf

Modified: user/glebius/course/05.memory/Makefile
==============================================================================
--- user/glebius/course/05.memory/Makefile	Wed Nov 27 23:26:54 2013	(r258700)
+++ user/glebius/course/05.memory/Makefile	Thu Nov 28 05:44:44 2013	(r258701)
@@ -12,6 +12,5 @@ TMP=	$(NAME).aux $(NAME).log $(NAME).nav
 clean:
 	rm -f -- $(TMP) texput.log
 
-cleanall:
-	make clean
+cleanall: clean
 	rm -f $(NAME).pdf

Modified: user/glebius/course/06.filedesc/Makefile
==============================================================================
--- user/glebius/course/06.filedesc/Makefile	Wed Nov 27 23:26:54 2013	(r258700)
+++ user/glebius/course/06.filedesc/Makefile	Thu Nov 28 05:44:44 2013	(r258701)
@@ -12,6 +12,5 @@ TMP=	$(NAME).aux $(NAME).log $(NAME).nav
 clean:
 	rm -f -- $(TMP) texput.log
 
-cleanall:
-	make clean
+cleanall: clean
 	rm -f $(NAME).pdf

Modified: user/glebius/course/07.io/Makefile
==============================================================================
--- user/glebius/course/07.io/Makefile	Wed Nov 27 23:26:54 2013	(r258700)
+++ user/glebius/course/07.io/Makefile	Thu Nov 28 05:44:44 2013	(r258701)
@@ -12,6 +12,5 @@ TMP=	$(NAME).aux $(NAME).log $(NAME).nav
 clean:
 	rm -f -- $(TMP) texput.log
 
-cleanall:
-	make clean
+cleanall: clean
 	rm -f $(NAME).pdf

Modified: user/glebius/course/08.io2/Makefile
==============================================================================
--- user/glebius/course/08.io2/Makefile	Wed Nov 27 23:26:54 2013	(r258700)
+++ user/glebius/course/08.io2/Makefile	Thu Nov 28 05:44:44 2013	(r258701)
@@ -12,6 +12,5 @@ TMP=	$(NAME).aux $(NAME).log $(NAME).nav
 clean:
 	rm -f -- $(TMP) texput.log
 
-cleanall:
-	make clean
+cleanall: clean
 	rm -f $(NAME).pdf

Modified: user/glebius/course/Makefile
==============================================================================
--- user/glebius/course/Makefile	Wed Nov 27 23:26:54 2013	(r258700)
+++ user/glebius/course/Makefile	Thu Nov 28 05:44:44 2013	(r258701)
@@ -1,35 +1,37 @@
-ALL:    build
+LECTURES=	01.intro \
+		02.entering_kernel \
+		03.processes\&threads \
+		04.synchronisation \
+		05.memory \
+		06.filedesc \
+		07.io \
+		08.io2
+
+.MAIN: build
 
 build:
 	@echo "Building individual chapters..."
-	cd 01.intro; make
-	cd 02.entering_kernel; make
-	cd 03.processes\&threads; make
-	cd 04.synchronisation; make
-	cd 05.memory; make
+	@for l in ${LECTURES}; do \
+		cd $${l}; make; cd -; \
+	done
 
 course:
 	@echo "Creating combined pdf..."
-	pdfjoin 01.intro/lection.pdf \
-		02.entering_kernel/lection.pdf \
-		03.processes\&threads/lection.pdf \
-		04.synchronisation/lection.pdf \
-		05.memory/lection.pdf \
-		-o course.pdf
+	@PDFS=""; \
+	for l in ${LECTURES}; do \
+		PDFS="$${PDFS} $${l}/lection.pdf"; \
+	done; \
+	pdfjoin $${PDFS} -o course.pdf
 
 clean:
 	@echo "Cleanup temp files..."
-	cd 01.intro; make clean
-	cd 02.entering_kernel; make clean
-	cd 03.processes\&threads; make clean
-	cd 04.synchronisation; make clean
-	cd 05.memory; make clean
+	@for l in ${LECTURES}; do \
+		cd $${l}; make ${.TARGET}; cd -; \
+	done
 
 cleanall:
 	@echo "Cleanup all files..."
-	cd 01.intro; make cleanall
-	cd 02.entering_kernel; make cleanall
-	cd 03.processes\&threads; make cleanall
-	cd 04.synchronisation; make cleanall
-	cd 05.memory; make cleanall
+	@for l in ${LECTURES}; do \
+		cd $${l}; make ${.TARGET}; cd -; \
+	done
 	rm -f course.pdf



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311280544.rAS5ijj9090352>