# ========================================================== # Makefile for 40 Computer Programs in Part 2 of Book # # To compile all of the programs, type: make all # To compile individual programs, type: make store1 # make enum # make ..... # # Written By: M. Austin September 1996 # ========================================================== .c.o: gcc -c -O $< # Computer Programs in Chapter 3 PROG1 = prog_storage1.o PROG2 = prog_enum.o PROG3 = prog_storage2.o # Computer Programs in Chapter 4 PROG4 = prog_increment.o PROG5 = prog_resistance.o PROG6 = prog_horner.o PROG7 = prog_bits_char.o PROG8 = prog_arithmetic.o # Computer Programs in Chapter 6 PROG9 = prog_factorial.o PROG10 = prog_call_by_value.o PROG11 = prog_scope1.o PROG12 = prog_scope2_file1.o prog_scope2_file2.o PROG13 = prog_math.o # Computer Programs in Chapter 7 PROG14 = prog_random.o PROG15 = prog_convolution.o PROG16 = prog_temperature.o PROG17 = prog_pointers1.o PROG18 = prog_pointers5.o PROG19 = prog_pointers2.o PROG20 = prog_pointers4.o PROG21 = prog_pointers3.o PROG22 = prog_pointers6.o # Computer Programs in Chapter 8 PROG23 = prog_swap.o PROG24 = prog_array1.o PROG25 = prog_gauss.o PROG26 = prog_array2.o PROG27 = prog_array3.o PROG28 = prog_strings.o PROG29 = prog_trapezoid.o PROG30 = prog_recursion.o # Computer Programs in Chapter 9 PROG31 = prog_savestring.o PROG32 = prog_vector.o miscellaneous.o PROG33 = prog_readdata.o miscellaneous.o PROG34 = prog_matrix.o miscellaneous.o PROG35 = prog_parser.o parser.o # Computer Programs in Chapter 10 PROG36 = prog_complex.o miscellaneous.o PROG37 = prog_lookup.o miscellaneous.o # Computer Programs in Chapter 14 PROG38 = prog_fileio.o convertcomplex.o miscellaneous.o PROG39 = prog_binary_io.o PROG40 = prog_sscanf.o miscellaneous.o # Compile all C Programs. all:: store1 enum store2 increment resist horner cbits arithmetic \ fact call scope1 scope2 math random convolution temp point1 \ point2 point5 point4 point3 point6 swap array1 gauss array2 \ array3 strings trap recursion savestring vector readdata \ matrix parser complex lookup fileio binary sscanf # Compile Individual C Programs. store1: $(PROG1) gcc $(PROG1) -lm -o STORE1 enum: $(PROG2) gcc $(PROG2) -lm -o ENUM store2: $(PROG3) gcc $(PROG3) -lm -o STORE2 increment: $(PROG4) gcc $(PROG4) -lm -o INCREMENT resist: $(PROG5) gcc $(PROG5) -lm -o RESIST horner: $(PROG6) gcc $(PROG6) -lm -o HORNER cbits: $(PROG7) gcc $(PROG7) -lm -o BITSC arithmetic: $(PROG8) gcc $(PROG8) -lm -o ARITHMETIC fact: $(PROG9) gcc $(PROG9) -lm -o FACTORIAL call: $(PROG10) gcc $(PROG10) -lm -o CALL scope1: $(PROG11) gcc $(PROG11) -lm -o SCOPE1 scope2: $(PROG12) gcc $(PROG12) -lm -o SCOPE2 math: $(PROG13) gcc $(PROG13) -lm -o MATH random: $(PROG14) gcc $(PROG14) -lm -o RANDOM convolution: $(PROG15) gcc $(PROG15) -lm -o CONVOLUTION temp: $(PROG16) gcc $(PROG16) -lm -o TEMP point1: $(PROG17) gcc $(PROG17) -lm -o POINT1 point2: $(PROG18) gcc $(PROG18) -lm -o POINT2 point5: $(PROG19) gcc $(PROG19) -lm -o POINT5 point4: $(PROG20) gcc $(PROG20) -lm -o POINT4 point3: $(PROG21) gcc $(PROG21) -lm -o POINT3 point6: $(PROG22) gcc $(PROG22) -lm -o POINT6 swap: $(PROG23) gcc $(PROG23) -lm -o SWAP array1: $(PROG24) gcc $(PROG24) -lm -o ARRAY1 gauss: $(PROG25) gcc $(PROG25) -lm -o GAUSS array2: $(PROG26) gcc $(PROG26) -lm -o ARRAY2 array3: $(PROG27) gcc $(PROG27) -lm -o ARRAY3 strings: $(PROG28) gcc $(PROG28) -lm -o STRINGS trap: $(PROG29) gcc $(PROG29) -lm -o TRAPEZOID recursion: $(PROG30) gcc $(PROG30) -lm -o RECURSION savestring: $(PROG31) gcc $(PROG31) -lm -o SAVESTRING vector: $(PROG32) gcc $(PROG32) -lm -o VECTOR readdata: $(PROG33) gcc $(PROG33) -lm -o READDATA matrix: $(PROG34) gcc $(PROG34) -lm -o MATRIX parser: $(PROG35) gcc $(PROG35) -lm -o PARSER complex: $(PROG36) gcc $(PROG36) -lm -o COMPLEX lookup: $(PROG37) gcc $(PROG37) -lm -o LOOKUP fileio: $(PROG38) gcc $(PROG38) -lm -o FILEIO binary: $(PROG39) gcc $(PROG39) -lm -o BINARY sscanf: $(PROG40) gcc $(PROG40) -lm -o SSCANF # Remove all object files and program output file. clean: /bin/rm -f *.o /bin/rm -f output-*