8 BINDIR ?
= $(PREFIX
)/bin
9 SHAREDIR ?
= $(PREFIX
)/share
10 MANDIR ?
= $(PREFIX
)/share
/man
12 CFLAGS
+= -std
=c99
-D_POSIX_C_SOURCE
=200809L
15 # CFLAGS += -g -O0 -pedantic -Wall -Wextra -Werror
17 # If you plan to use clav-flip-finder, it is highly recommended that you enable -O3
18 # CFLAGS += -O3 -Wall -Wextra -Werror
22 MUTFINDPROG
= clav-mutation-find
24 SDL_FONT
=\"/usr
/share
/fonts
/dejavu
/DejaVuSansMono.ttf
\"
29 all: $(SDLPROG
) $(TEXTPROG
) $(MUTFINDPROG
)
31 $(SDLPROG
): clav.o quiver.o ui-sdl.o file-selection.o
32 $(CC
) -o
$@
$^
$(LDFLAGS
) -lm
$(shell pkg-config
--libs sdl2 SDL2_ttf
)
34 $(TEXTPROG
): clav.o quiver.o ui-cli.o
35 $(CC
) -o
$@
$^
$(LDFLAGS
)
37 $(MUTFINDPROG
): mutation-finder.o quiver.o
38 $(CC
) -o
$@
$^
$(LDFLAGS
)
40 clav.o
: clav.c macros.h ui.h quiver.h
41 $(CC
) $(CFLAGS
) -c
-o
$@
$<
43 quiver.o
: quiver.c macros.h ui.h quiver.h
44 $(CC
) $(CFLAGS
) -c
-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 quiver.h
50 $(CC
) $(CFLAGS
) -c
-o
$@
$<
52 file-selection.o
: file-selection.c file-selection.h macros.h
53 $(CC
) $(CFLAGS
) -c
-o
$@
$<
55 mutation-finder.o
: mutation-finder.c macros.h quiver.h
56 $(CC
) $(CFLAGS
) -c
-o
$@
$<
60 find
-name
'*.o' -delete
61 find
-name
'*~' -delete
68 mkdir
-p
$(DESTDIR
)$(BINDIR
)
69 cp
-f
$(SDLPROG
) $(DESTDIR
)$(BINDIR
)/
70 cp
-f
$(TEXTPROG
) $(DESTDIR
)$(BINDIR
)/
71 cp
-f
$(MUTFINDPROG
) $(DESTDIR
)$(BINDIR
)/
72 mkdir
-p
$(DESTDIR
)$(SHAREDIR
)/clav
73 cp
-f data
/*.txt
$(DESTDIR
)$(SHAREDIR
)/clav
/
74 mkdir
-p
$(DESTDIR
)$(MANDIR
)/man1
75 cp
-f clav
.1 $(DESTDIR
)$(MANDIR
)/man1
/
76 cp
-f clav-cli
.1 $(DESTDIR
)$(MANDIR
)/man1
/
77 cp
-f clav-sdl
.1 $(DESTDIR
)$(MANDIR
)/man1
/
78 cp
-f clav-mutation-find
.1 $(DESTDIR
)$(MANDIR
)/man1
/
82 cd
$(DESTDIR
)$(BINDIR
) && rm -f
$(SDLPROG
)
83 cd
$(DESTDIR
)$(BINDIR
) && rm -f
$(TEXTPROG
)
84 cd
$(DESTDIR
)$(BINDIR
) && rm -f
$(MUTFINDPROG
)
85 cd
$(DESTDIR
)$(SHAREDIR
) && rm -rf clav
86 cd
$(DESTDIR
)$(MANDIR
)/man1
&& rm -f clav
.1 clav-mutation-find
.1 clav-cli
.1 clav-sdl
.1