Browse Source

Add linker flag for math library; add header file to dependencies

T. Meissner 6 months ago
parent
commit
85c06130ed
4 changed files with 6 additions and 6 deletions
  1. 1
    1
      chapter_07/Makefile
  2. 1
    1
      chapter_08/Makefile
  3. 2
    2
      chapter_09/Makefile
  4. 2
    2
      chapter_10/Makefile

+ 1
- 1
chapter_07/Makefile View File

@@ -5,7 +5,7 @@ all: lispy
5 5
 
6 6
 
7 7
 %: %.c
8
-	cc -std=c11 -Wall $@.c ${MPC_DIR}/mpc.c -ledit -o $@
8
+	cc -std=c11 -Wall $@.c ${MPC_DIR}/mpc.c -ledit -lm -o $@
9 9
 
10 10
 
11 11
 .PHONY: clean

+ 1
- 1
chapter_08/Makefile View File

@@ -5,7 +5,7 @@ all: lispy
5 5
 
6 6
 
7 7
 %: %.c
8
-	cc -std=c11 -Wall $@.c ${MPC_DIR}/mpc.c -ledit -o $@
8
+	cc -std=c11 -Wall $@.c ${MPC_DIR}/mpc.c -ledit -lm -o $@
9 9
 
10 10
 
11 11
 .PHONY: clean

+ 2
- 2
chapter_09/Makefile View File

@@ -4,8 +4,8 @@ MPC_DIR := ../mpc
4 4
 all: lispy
5 5
 
6 6
 
7
-%: %.c
8
-	cc -std=c11 -Wall $@.c ${MPC_DIR}/mpc.c -ledit -o $@
7
+%: %.c %.h
8
+	cc -std=c11 -Wall $@.c ${MPC_DIR}/mpc.c -ledit -lm-o $@
9 9
 
10 10
 
11 11
 .PHONY: clean

+ 2
- 2
chapter_10/Makefile View File

@@ -4,8 +4,8 @@ MPC_DIR := ../mpc
4 4
 all: lispy
5 5
 
6 6
 
7
-%: %.c
8
-	cc -std=c11 -Wall $@.c ${MPC_DIR}/mpc.c -ledit -o $@
7
+%: %.c %.h
8
+	cc -std=c11 -Wall -Wextra $@.c ${MPC_DIR}/mpc.c -ledit -lm -o $@
9 9
 
10 10
 
11 11
 .PHONY: clean