9 BINDIR ?
= $(PREFIX
)/bin
10 MANDIR ?
= $(PREFIX
)/share
/man
13 CFLAGS
+= -std
=c99
-D_XOPEN_SOURCE
17 CFLAGS
+= -g
-O0
-pedantic
-Wall
-Wextra
-Werror
22 SDL_FONT
=\"/usr
/share
/fonts
/dejavu
/DejaVuSansMono.ttf
\"
29 all: $(SDLPROG
) $(TEXTPROG
)
34 clav.o
: clav.c macros.h ui.h quiver.h
35 $(CC
) $(CFLAGS
) -c
-o
$@
$<
37 quiver.o
: quiver.c macros.h ui.h quiver.h
38 $(CC
) $(CFLAGS
) -c
-o
$@
$<
40 $(SDLPROG
): clav.o quiver.o ui-sdl.o
41 $(LD
) $(LDFLAGS
) -lm
$(shell pkg-config
--libs sdl2 SDL2_ttf
) -o
$@
$^
43 $(TEXTPROG
): clav.o quiver.o ui-cli.o
44 $(LD
) $(LDFLAGS
) -o
$@
$^
46 ui-sdl.o
: ui-sdl.c macros.h ui.h quiver.h
47 $(CC
) $(CFLAGS
) -DFONT_PATH
=$(SDL_FONT
) $(shell pkg-config
--cflags sdl2 SDL2_ttf
) -c
-o
$@
$<
49 ui-cli.o
: ui-cli.c macros.h
50 $(CC
) $(CFLAGS
) -c
-o
$@
$<
54 find
-name
'*.o' -delete
55 find
-name
'*~' -delete
60 mkdir
-p
$(DESTDIR
)$(BINDIR
)
61 cp
-f
$(SDLPROG
) $(DESTDIR
)$(BINDIR
)/
62 mkdir
-p
$(DESTDIR
)$(MANDIR
)/man1
63 cp
-f
$(MAN
) $(DESTDIR
)$(MANDIR
)/man1
/
67 cd
$(DESTDIR
)$(BINDIR
) && rm -f
$(SDLPROG
)
68 cd
$(DESTDIR
)$(MANDIR
)/man1
&& rm -f
$(MAN
)