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
29 GRAPHISOPROG
= clav-check-graph-isomorphism
34 all: $(SDLPROG
) $(TEXTPROG
) $(MUTFINDPROG
) $(BFZIIIPROG
) $(GRAPHISOPROG
)
36 $(SDLPROG
): clav.o quiver.o ui-sdl.o ui-sdl-font.o color-selection.o file-selection.o
37 $(CC
) -o
$@
$^
$(LDFLAGS
) -lm
$(shell pkg-config
$(PCSTATIC
) --libs sdl2 SDL2_ttf
)
39 $(TEXTPROG
): clav.o quiver.o ui-cli.o
40 $(CC
) -o
$@
$^
$(LDFLAGS
)
42 $(MUTFINDPROG
): mutation-finder.o quiver.o
43 $(CC
) -o
$@
$^
$(LDFLAGS
)
45 $(BFZIIIPROG
): bfzIII.o quiver.o
46 $(CC
) -o
$@
$^
$(LDFLAGS
)
48 $(GRAPHISOPROG
): check-graph-iso.o quiver.o
49 $(CC
) -o
$@
$^
$(LDFLAGS
)
51 clav.o
: clav.c macros.h ui.h quiver.h
52 $(CC
) $(CFLAGS
) -c
-o
$@
$<
54 quiver.o
: quiver.c macros.h ui.h quiver.h
55 $(CC
) $(CFLAGS
) -c
-o
$@
$<
57 ui-sdl.o
: ui-sdl.c macros.h ui.h quiver.h color-selection.h file-selection.h ui-sdl-font.h
58 $(CC
) $(CFLAGS
) $(shell pkg-config
$(PCSTATIC
) --cflags sdl2 SDL2_ttf
) -c
-o
$@
$<
60 ui-sdl-font.o
: ui-sdl-font.c
61 $(CC
) $(CFLAGS
) -c
-o
$@
$<
63 ui-cli.o
: ui-cli.c macros.h quiver.h
64 $(CC
) $(CFLAGS
) -c
-o
$@
$<
66 file-selection.o
: file-selection.c file-selection.h macros.h
67 $(CC
) $(CFLAGS
) -c
-o
$@
$<
69 color-selection.o
: color-selection.c color-selection.h macros.h
70 $(CC
) $(CFLAGS
) -c
-o
$@
$<
72 mutation-finder.o
: mutation-finder.c macros.h quiver.h
73 $(CC
) $(CFLAGS
) -c
-o
$@
$<
75 bfzIII.o
: bfzIII.c macros.h quiver.h
76 $(CC
) $(CFLAGS
) -c
-o
$@
$<
78 check-graph-iso.o
: check-graph-iso.c macros.h quiver.h
79 $(CC
) $(CFLAGS
) -c
-o
$@
$<
93 mkdir
-p
$(DESTDIR
)$(BINDIR
)
94 cp
-f
$(SDLPROG
) $(DESTDIR
)$(BINDIR
)/
95 cp
-f
$(TEXTPROG
) $(DESTDIR
)$(BINDIR
)/
96 cp
-f
$(MUTFINDPROG
) $(DESTDIR
)$(BINDIR
)/
97 cp
-f
$(BFZIIIPROG
) $(DESTDIR
)$(BINDIR
)/
98 cp
-f
$(GRAPHISOPROG
) $(DESTDIR
)$(BINDIR
)/
99 mkdir
-p
$(DESTDIR
)$(SHAREDIR
)/clav
100 cp
-f data
/*.txt
$(DESTDIR
)$(SHAREDIR
)/clav
/
101 mkdir
-p
$(DESTDIR
)$(MANDIR
)/man1
102 cp
-f clav
.1 $(DESTDIR
)$(MANDIR
)/man1
/
103 cp
-f clav-cli
.1 $(DESTDIR
)$(MANDIR
)/man1
/
104 cp
-f clav-sdl
.1 $(DESTDIR
)$(MANDIR
)/man1
/
105 cp
-f clav-mutation-find
.1 $(DESTDIR
)$(MANDIR
)/man1
/
109 cd
$(DESTDIR
)$(BINDIR
) && rm -f
$(SDLPROG
)
110 cd
$(DESTDIR
)$(BINDIR
) && rm -f
$(TEXTPROG
)
111 cd
$(DESTDIR
)$(BINDIR
) && rm -f
$(MUTFINDPROG
)
112 cd
$(DESTDIR
)$(BINDIR
) && rm -f
$(BFZIIIPROG
)
113 cd
$(DESTDIR
)$(BINDIR
) && rm -f
$(GRAPHISOPROG
)
114 cd
$(DESTDIR
)$(SHAREDIR
) && rm -rf clav
115 cd
$(DESTDIR
)$(MANDIR
)/man1
&& rm -f clav
.1 clav-mutation-find
.1 clav-cli
.1 clav-sdl
.1