# We've mostly used gcc to run the preprocessor, compiler, and linker all in one step. 1114 gcc -o talk main.c speak.c shout.c 1115 ./talk # Below we see how they can be run separately 1099 gcc -E shout.c > shout_pre.c 1100 gcc -E speak.c > speak_pre.c 1101 gcc -E main.c > main_pre.c 1105 gcc -c -o shout.o shout_pre.c 1108* gcc -c -o speak.o speak_pre.c 1109 gcc -c -o main.o main._pre.c 1110 ls *.o 1111* gcc -o talk main.o speak.o shout.o 1113 ./talk # We examined the talk source files to see the #include's 1123 vim main.c 1124 vim shout.c 1125 vim speak.c 1133 vim Makefile # run the talk target, which performs all commands to create talk 1134 make -f Makefile talk # clean up 1134 rm talk *.o # Run just the speak.o target 1134 make -f Makefile speak.o # Now when we run the talk target, the gcc commands to create speak.o don't run since speak.o is up-to-date 1136 make -f Makefile talk # Running this again, nothing needs to happen 1139 make -f Makefile talk # Now we make a small change to shout.c, to see that only some commands need to be re-run, # but in particular speak.o does not have to get re-created. 1140 vim shout.c # edit and save 1141 make -f Makefile talk # Finally, by default make will use the file 'Makefile', so this works too 1142 make talk # also by default, make will use the first target in the Makefile, so the following runs talk target 1143 make 1143 history > make.history