SHARE
TWEET

Untitled

a guest Apr 21st, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # COMP20007 Design of Algorithms
  2. # 2019 Semester 1
  3. #
  4. # Assignment 1 Makefile
  5. # Created by Tobias Edwards <tobias.edwards@unimelb.edu.au>
  6.  
  7. CC     = gcc
  8. CFLAGS = -g -Wall -std=c99
  9. EXE    = a1
  10. OBJ    = main.o point.o deque.o convex-hull.o list.o
  11.  
  12. # Default Target, so "$ make" or "$ make all" will do this
  13. all: $(EXE)
  14.  
  15. # Create the executable
  16. $(EXE): $(OBJ)
  17.     $(CC) $(CFLAGS) -o $(EXE) $(OBJ)
  18.  
  19. # Other Dependencies
  20. point.o: point.h point.c
  21.     $(CC) $(CFLAGS) -c point.c
  22. deque.o: deque.h deque.c
  23.     $(CC) $(CFLAGS) -c deque.c
  24. convex-hull.o: convex-hull.h convex-hull.c
  25.     $(CC) $(CFLAGS) -c convex-hull.c
  26.  
  27. # TODO: Add any other dependencies you may create
  28. list.o: list.h list.c
  29.     $(CC) $(CFLAGS) -c list.c
  30.  
  31.  
  32. # test command to run - 15 ouput files
  33. test1:
  34.     ./a1 -o < sample_input/orientation-1-in.txt > test_output/out1.txt
  35.     diff sample_input/orientation-1-out.txt test_output/out1.txt
  36. test2:
  37.     ./a1 -o < sample_input/orientation-2-in.txt > test_output/out2.txt
  38.     diff sample_input/orientation-2-out.txt test_output/out2.txt
  39. test3:
  40.     ./a1 -o < sample_input/orientation-3-in.txt > test_output/out3.txt
  41.     diff sample_input/orientation-3-out.txt test_output/out3.txt
  42. test4:
  43.     ./a1 -o < sample_input/orientation-4-in.txt > test_output/out4.txt
  44.     diff sample_input/orientation-4-out.txt test_output/out4.txt
  45. test5:
  46.     ./a1 -o < sample_input/orientation-5-in.txt > test_output/out5.txt
  47.     diff sample_input/orientation-5-out.txt test_output/out5.txt
  48. test_1:
  49.     ./a1 -d < sample_input/deque-1-in.txt > test_output/out_1.txt
  50.     diff sample_input/deque-1-out.txt test_output/out_1.txt
  51. test_2:
  52.     ./a1 -d < sample_input/deque-2-in.txt > test_output/out_2.txt
  53.     diff sample_input/deque-2-out.txt test_output/out_2.txt
  54. test_3:
  55.     ./a1 -d < sample_input/deque-3-in.txt > test_output/out_3.txt
  56.     diff sample_input/deque-3-out.txt test_output/out_3.txt
  57. test_4:
  58.     ./a1 -d < sample_input/deque-4-in.txt > test_output/out_4.txt
  59.     diff sample_input/deque-4-out.txt test_output/out_4.txt
  60. test_5:
  61.     ./a1 -d < sample_input/deque-5-in.txt > test_output/out_5.txt
  62.     diff sample_input/deque-5-out.txt test_output/out_5.txt
  63. test__1:
  64.     ./a1 -i < sample_input/inside-hull-1-in.txt > test_output/out__1.txt
  65.     diff sample_input/inside-hull-1-out.txt test_output/out__1.txt
  66. test__2:
  67.     ./a1 -i < sample_input/inside-hull-2-in.txt > test_output/out__2.txt
  68.     diff sample_input/inside-hull-2-out.txt test_output/out__2.txt
  69. test__3:
  70.     ./a1 -i < sample_input/inside-hull-3-in.txt > test_output/out__3.txt
  71.     diff sample_input/inside-hull-3-out.txt test_output/out__3.txt
  72. test__4:
  73.     ./a1 -i < sample_input/inside-hull-4-in.txt > test_output/out__4.txt
  74.     diff sample_input/inside-hull-4-out.txt test_output/out__4.txt
  75. test__5:
  76.     ./a1 -i < sample_input/inside-hull-5-in.txt > test_output/out__5.txt
  77.     diff sample_input/inside-hull-5-out.txt test_output/out__5.txt
  78.  
  79. # append all tests together
  80. test: test1 test2 test3 test4 test5 test_1 test_2 test_3 test_4 test_5 test__1 test__2 test__3 test__4 test__5 test__5
  81.  
  82. # "clean" and "all" don't actually create files called "clean" and "all"
  83. # and are thus "Phony Targets"
  84. .PHONY: clean submit all
  85.  
  86. # Run "$ make clean" to remove the object and executable files
  87. clean:
  88.     rm -f $(OBJ) $(EXE)
  89.  
  90. # Run "$ make submit" to create submission.zip
  91. submit: clean
  92.     zip -r submission.zip .
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top