File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -94,11 +94,23 @@ Recall from lecture that we can automate the process of executing `clang`, letti
94
94
95
95
Create a new file called ` Makefile ` (no dot! no extension) and enter into it the following lines:
96
96
97
+ ** Windows/Ubuntu/Old Mac version**
98
+
97
99
# Makefile for CS50-type assignments
98
100
99
101
%: %.c
100
102
clang -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow -o $@ $< -lcs50 -lcrypt -lm
101
103
104
+ ** Mac M1 version**
105
+
106
+ # Makefile for CS50-type assignments
107
+
108
+ INCLUDE_PATH=${HOMEBREW_PREFIX}/opt/libcs50/include
109
+ LIBRARY_PATH=${HOMEBREW_PREFIX}/opt/libcs50/lib
110
+
111
+ %: %.c
112
+ clang -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow -I${INCLUDE_PATH} -o $@ $< -L${LIBRARY_PATH} -lcs50 -lcrypt -lm
113
+
102
114
Make sure that right before "clang" in that last line is a TAB character and not 4 spaces. Save the file.
103
115
104
116
Now execute the below to compile your program one last time.
You can’t perform that action at this time.
0 commit comments