8 ifneq (,$(findstring -static
,$(LDFLAGS
)))
13 BINDIR ?
= $(PREFIX
)/bin
14 SHAREDIR ?
= $(PREFIX
)/share
15 MANDIR ?
= $(PREFIX
)/share
/man
17 CFLAGS
+= -std
=c99
-D_POSIX_C_SOURCE
=200809L
20 # CFLAGS += -g -O0 -pedantic -Wall -Wextra -Werror
22 # If you plan to use clav-mutation-find, it is highly recommended that you enable -O3
23 # CFLAGS += -O3 -Wall -Wextra -Werror
27 MUTFINDPROG
= clav-mutation-find
28 BFZIIIPROG
= clav-bfzIII
33 all: $(SDLPROG
) $(TEXTPROG
) $(MUTFINDPROG
) $(BFZIIIPROG
)
35 $(SDLPROG
): clav.o quiver.o ui-sdl.o ui-sdl-font.o color-selection.o file-selection.o
36 $(CC
) -o
$@
$^
$(LDFLAGS
) -lm
$(shell pkg-config
$(PCSTATIC
) --libs sdl2 SDL2_ttf
)
38 $(TEXTPROG
): clav.o quiver.o ui-cli.o
39 $(CC
) -o
$@
$^
$(LDFLAGS
)
41 $(MUTFINDPROG
): mutation-finder.o quiver.o
42 $(CC
) -o
$@
$^
$(LDFLAGS
)
44 $(BFZIIIPROG
): bfzIII.o quiver.o
45 $(CC
) -o
$@
$^
$(LDFLAGS
)
47 clav.o
: clav.c macros.h ui.h quiver.h
48 $(CC
) $(CFLAGS
) -c
-o
$@
$<
50 quiver.o
: quiver.c macros.h ui.h quiver.h
51 $(CC
) $(CFLAGS
) -c
-o
$@
$<
53 ui-sdl.o
: ui-sdl.c macros.h ui.h quiver.h color-selection.h file-selection.h ui-sdl-font.h
54 $(CC
) $(CFLAGS
) $(shell pkg-config
$(PCSTATIC
) --cflags sdl2 SDL2_ttf
) -c
-o
$@
$<
56 ui-sdl-font.o
: ui-sdl-font.c
57 $(CC
) $(CFLAGS
) -c
-o
$@
$<
59 ui-cli.o
: ui-cli.c macros.h quiver.h
60 $(CC
) $(CFLAGS
) -c
-o
$@
$<
62 file-selection.o
: file-selection.c file-selection.h macros.h
63 $(CC
) $(CFLAGS
) -c
-o
$@
$<
65 color-selection.o
: color-selection.c color-selection.h macros.h
66 $(CC
) $(CFLAGS
) -c
-o
$@
$<
68 mutation-finder.o
: mutation-finder.c macros.h quiver.h
69 $(CC
) $(CFLAGS
) -c
-o
$@
$<
71 bfzIII.o
: bfzIII.c macros.h quiver.h
72 $(CC
) $(CFLAGS
) -c
-o
$@
$<
84 mkdir
-p
$(DESTDIR
)$(BINDIR
)
85 cp
-f
$(SDLPROG
) $(DESTDIR
)$(BINDIR
)/
86 cp
-f
$(TEXTPROG
) $(DESTDIR
)$(BINDIR
)/
87 cp
-f
$(MUTFINDPROG
) $(DESTDIR
)$(BINDIR
)/
88 cp
-f
$(BFZIIIPROG
) $(DESTDIR
)$(BINDIR
)/
89 mkdir
-p
$(DESTDIR
)$(SHAREDIR
)/clav
90 cp
-f data
/*.txt
$(DESTDIR
)$(SHAREDIR
)/clav
/
91 mkdir
-p
$(DESTDIR
)$(MANDIR
)/man1
92 cp
-f clav
.1 $(DESTDIR
)$(MANDIR
)/man1
/
93 cp
-f clav-cli
.1 $(DESTDIR
)$(MANDIR
)/man1
/
94 cp
-f clav-sdl
.1 $(DESTDIR
)$(MANDIR
)/man1
/
95 cp
-f clav-mutation-find
.1 $(DESTDIR
)$(MANDIR
)/man1
/
99 cd
$(DESTDIR
)$(BINDIR
) && rm -f
$(SDLPROG
)
100 cd
$(DESTDIR
)$(BINDIR
) && rm -f
$(TEXTPROG
)
101 cd
$(DESTDIR
)$(BINDIR
) && rm -f
$(MUTFINDPROG
)
102 cd
$(DESTDIR
)$(BINDIR
) && rm -f
$(BFZIIIPROG
)
103 cd
$(DESTDIR
)$(SHAREDIR
) && rm -rf clav
104 cd
$(DESTDIR
)$(MANDIR
)/man1
&& rm -f clav
.1 clav-mutation-find
.1 clav-cli
.1 clav-sdl
.1