forked from basil00/Fathom
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile
34 lines (26 loc) · 807 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
MKDIR_P = mkdir -p
RM = rm
INSTALL = install
CC ?= gcc
CFLAGS = -std=gnu99 -O2 -Wall -Wshadow -Isrc
LDFLAGS = $(CFLAGS)
PREFIX = /usr/local
LIBDIR = $(PREFIX)/lib64
INCDIR = $(PREFIX)/include
libfathom.so: obj/tbprobe.o
$(CC) $(LDFLAGS) -shared $^ -o $@
obj/tbprobe.o: src/tbprobe.c src/tbchess.c src/stdendian.h src/tbprobe.h
@$(MKDIR_P) obj
$(CC) $(CFLAGS) -fPIC -c $< -o $@
clean:
$(RM) -f libfathom.so
$(RM) -rf obj
install: libfathom.so
$(MKDIR_P) $(DESTDIR)$(LIBDIR)
$(MKDIR_P) $(DESTDIR)$(INCDIR)
$(INSTALL) -m 0644 libfathom.so $(DESTDIR)$(LIBDIR)
$(INSTALL) -m 0644 src/{stdendian,tbconfig,tbprobe}.h $(DESTDIR)$(INCDIR)
uninstall:
$(RM) -f $(DESTDIR)$(LIBDIR)/libfathom.so
$(RM) -f $(DESTDIR)$(INCDIR)/{stdendian,tbconfig,tbprobe}.h
.PHONY: clean install uninstall