0

I am doing an assignment in C where I need to read in characters from a text file that contains the works of Shakespeare. My professor wants me to do the following: "Write a make file that can compile and run the C program you write. Specifically, when I type

$ make run textfile=CompleteShakespeare.txt

your program should analyze the text file of CompleteShakespeare.txt. I don't really know how to go about this. Is CompleteShakespeare.txt inputted as argv[1] here? Any help would be appreciated, thanks!

lurker
  • 56,987
  • 9
  • 69
  • 103
  • `make` will do whatever the `Makefile` or `makefile` says to do. You need to create a `makefile`. You can do an internet search on "how to create a makefile". `run` is a "target" and `textfile=CompleteShakespeare.txt` sets the makefile variable `textfile` to "CompleteShakespeare.txt". – lurker Jun 16 '20 at 00:21
  • you need the makefile to call the compiler with '-DFILE_PATH=Shakespeare.txt' – pm100 Jun 16 '20 at 01:30

0 Answers0