.gitignore: Ignore the generated distribution tarball
[assignment-template.git] / Makefile
index 44af03efa61438e9641eecdb7d1ea61f368c0e55..af2d15bbbc003d4a322be1236b70dfab14e2abb0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,7 @@ PACKAGE = hw0
 VERSION = 1
 RELEASE = $(COURSE)-$(PACKAGE)-$(VERSION)
 RUN_PROGRAM = hello_world
-SCRIPTS = 
+SCRIPTS =
 C_PROGRAMS = hello_world
 CXX_PROGRAMS = goodbye_world
 PROGRAMS = $(C_PROGRAMS) $(CXX_PROGRAMS)
@@ -84,9 +84,9 @@ dist:
 
 # target: hello_world - compile the hello_world program
 # Use GCC to link the program from object files.
-# For an explanation of the
+# For an explanation of the static pattern rule syntax:
 #   targets ...: target-pattern: prereq-patterns ...
-# syntax, see
+# see
 #   http://www.gnu.org/software/make/manual/html_node/Static-Usage.html
 # For an explanation of $@, $^, and other special variables, see
 #   http://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html
@@ -120,11 +120,11 @@ dist:
 # certainly allowed to go that route if you wish.
 .SECONDEXPANSION:
 $(C_PROGRAMS): % : $$($$(@)_OBJECTS)
-       $(CC) $(LDFLAGS) -o $@ $^ $($(@)_LIBS)
+       $(CC) $(LDFLAGS) -o "$@" $^ $($(@)_LIBS)
 
 .SECONDEXPANSION:
 $(CXX_PROGRAMS): % : $$($$(*)_OBJECTS)
-       $(CXX) $(LDFLAGS) -o $@ $^ $($(@)_LIBS)
+       $(CXX) $(LDFLAGS) -o "$@" $^ $($(@)_LIBS)
 
 # target: run - use the program for its intended purpose
 # Here we just execute RUN_PROGRAM, but you could also use something
@@ -152,12 +152,12 @@ run: $(PROGRAMS)
 # for example, try
 #    $ make CXX=/usr/local/bin/g++ CXXFLAGS=-Wall
 %.o: %.cpp
-       $(CXX) $(CXXFLAGS) -c $<
+       $(CXX) $(CXXFLAGS) -c "$<"
 
 # Pattern rule for compiling object files from C source
 # The comments from the C++ rule above also apply here
 %.o: %.c
-       $(CC) $(CFLAGS) -c $<
+       $(CC) $(CFLAGS) -c "$<"
 
 # target: print-% - display a variable value (e.g. print-PROGRAMS)
 # Take some of the mystery out of variable manipulation.  For example,