Skip to content

Commit 3714ca3

Browse files
committed
Fix Makefile targets
- Make it so produced binary and target name are the same - Make install target depend on the binary
1 parent 0420345 commit 3714ca3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ CFLAGS?= -O2 -finline-functions -funswitch-loops -fgcse-after-reload -fpredictiv
66
CFLAGS+= `sdl2-config --cflags` -DDATADIR="\"$(PREFIX)/share/abbayev2\""
77
LIBS= `sdl2-config --libs` -lSDL2_image -lSDL2_mixer -lm
88

9+
PROG= abbayev2
910
SRCS= src/drawing.c \
1011
src/ending.c \
1112
src/enemies.c \
@@ -17,17 +18,17 @@ SRCS= src/drawing.c \
1718
src/main.c \
1819
src/startscreen.c
1920

20-
all: abbaye
21+
all: $(PROG)
2122

22-
abbaye: ./src/main.c ./src/loading.c ./src/startscreen.c ./src/history.c ./src/game.c ./src/jean.c ./src/enemies.c ./src/gameover.c ./src/ending.c ./src/drawing.c
23-
$(CC) $(CFLAGS) $(SRCS) -o abbayev2 $(LIBS)
23+
$(PROG): ./src/main.c ./src/loading.c ./src/startscreen.c ./src/history.c ./src/game.c ./src/jean.c ./src/enemies.c ./src/gameover.c ./src/ending.c ./src/drawing.c
24+
$(CC) $(CFLAGS) $(SRCS) -o $(PROG) $(LIBS)
2425

2526
clean:
2627

2728
rm -rf ./abbayev2
2829

2930
# Installation
30-
install:
31+
install: $(PROG)
3132
cp abbayev2 $(DESTDIR)$(PREFIX)/bin/
3233
cp abbaye.desktop $(DESTDIR)$(PREFIX)/share/applications
3334
mkdir -p $(DESTDIR)$(PREFIX)/share/abbayev2/sounds

0 commit comments

Comments
 (0)