Guest User

Untitled

a guest
Jul 22nd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. PERL=perl
  2. CFLAGS=-I./include -Wall -g -Wextra
  3. CXXFLAGS=$(CFLAGS)
  4. LD_FLAGS=-lm
  5. OBJ_FILES := src/pin.o src/hardware_serial.o src/pin_commands.o src/private_config.o src/timing.o src/main.o src/arduino.o src/rand_num.o $(EXT_OBJ_FILES)
  6. SRC_FILES := src/pin.cc src/hardware_serial.cc src/pin_commands.cc src/private_config.cc src/timing.cc src/main.cc src/arduino.cc src/rand_num.cc $(EXT_FILES)
  7. LIB_FILE := libardunio-emulation.a
  8.  
  9. all: staticlib test
  10.  
  11. staticlib: $(LIB_FILE)
  12.  
  13. sample: $(LIB_FILE) student.o
  14. $(CXX) $(CXXFLAGS) -v -o $@ student.o $(LIB_FILE) $(LD_FLAGS)
  15.  
  16. $(LIB_FILE) : $(OBJ_FILES)
  17. $(AR) cvsrS $(LIB_FILE) $?
  18. ranlib $(LIB_FILE)
  19.  
  20. %.o: %.cc
  21. $(CXX) $(CXXFLAGS) -c $< -o $@
  22.  
  23. test: $(LIB_FILE) sample
  24. time ./sample t/simple.scn
  25.  
  26. t1: $(LIB_FILE) sample
  27. time ./sample t/one.scn
  28.  
  29. t2: $(LIB_FILE) sample
  30. time ./sample t/uni.scn
  31.  
  32. %.scn: $(LIB_FILE) sample
  33. @./sample $@
  34.  
  35. t/*.scn: $(LIB_FILE) sample
  36. @./sample $@
  37.  
  38. hw1: $(LIB_FILE)
  39. mkdir -p ./homeworks/hw1
  40. cp ./$(LIB_FILE) ./homeworks/hw1
  41. cp templates/student.cc ./homeworks/hw1/lab1.cc
  42. cp templates/Makefile ./homeworks/hw1
  43. cp templates/t1.scn ./homeworks/hw1
  44. cp templates/t2.scn ./homeworks/hw1
  45. cp templates/t3.scn ./homeworks/hw1
  46. cp templates/t4.scn ./homeworks/hw1
  47. cp templates/t5.scn ./homeworks/hw1
  48. cp templates/t6.scn ./homeworks/hw1
  49. cp templates/t7.scn ./homeworks/hw1
  50. cp templates/t8.scn ./homeworks/hw1
  51. cp templates/t9.scn ./homeworks/hw1
  52. cp templates/t10.scn ./homeworks/hw1
  53. cp templates/t11.scn ./homeworks/hw1
  54. cp templates/t12.scn ./homeworks/hw1
  55. cp include/arduino_api.h ./homeworks/hw1
  56. tar -C ./homeworks -czf hw1.tar.gz ./hw1
  57.  
  58. clean:
  59. $(RM) $(OBJ_FILES) $(LIB_FILE)
  60.  
  61. help:
  62. @echo ""
  63. @echo "Arduino Emulator Project"
  64. @echo ""
  65. @echo "Commands:"
  66. @echo " test: Tests the Arduino Emulator framework."
  67. @echo " staticlib: Builds the link files."
  68. @echo " samples: Builds student object files."
  69. @echo " clean: Removes all old build files."
  70. @echo " help: Prints this help message."
  71. @echo ""
Add Comment
Please, Sign In to add comment