File: use-variables-in-Makefile.patch

package info (click to toggle)
petris 1.0.1-11.1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 244 kB
  • sloc: ansic: 1,920; sh: 34; makefile: 29
file content (31 lines) | stat: -rw-r--r-- 955 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Description: Use variables in Makefile
 Added variables CC, CFLAGS & LIBS to Makefile so build system can use them.
 Move ${LIBS} to the end of line for petris target so that 'ld --as-needed' works.
Author: Andree Leidenfrost <andree@debian.org>
Index: petris-1.0.1/Makefile
===================================================================
--- petris-1.0.1.orig/Makefile
+++ petris-1.0.1/Makefile
@@ -1,14 +1,17 @@
+CFLAGS+=-Wall
+LIBS=-lncurses
+
 petris : main.o game.o highscore.o
-	gcc -o petris main.o game.o highscore.o -lncurses
+	$(CC) -o petris main.o game.o highscore.o ${LIBS}
 
 main.o : main.c game.h petris.h
-	gcc -Wall -c main.c
+	$(CC) ${CFLAGS} -c main.c
 
 game.o : game.c game.h petris.h config.h
-	gcc -Wall -c game.c
+	$(CC) ${CFLAGS} -c game.c
 
 highscore.o : highscore.c highscore.h config.h
-	gcc -Wall -c highscore.c
+	$(CC) ${CFLAGS} -c highscore.c
 
 clean:
-	rm main.o game.o highscore.o
+	rm -f main.o game.o highscore.o