-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (26 loc) · 863 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
CFLAGS = -std=c11 -O3 -Wall -Wextra -I./include -flto -fPIC -fstrict-aliasing
LDFLAGS = -shared
Prefix = /usr
Package = mt19937
Header = include/$(Package).h
HeaderDestination = $(Prefix)/include/$(Package).h
ifeq ($(OS), Windows_NT)
Library = lib/$(Package).dll
LibraryDestination = $(Prefix)/lib/$(Package).dll
LibraryDestinationWindows = $(Prefix)/bin/$(Package).dll
else
Library = lib/$(Package).so
LibraryDestination = $(Prefix)/lib/lib$(Package).so
endif
.PHONY: install uninstall
install: uninstall $(Library)
cp $(Header) $(HeaderDestination)
cp $(Library) $(LibraryDestination)
if [ -n "$(LibraryDestinationWindows)" ]; \
then \
cp $(Library) $(LibraryDestinationWindows); \
fi
$(Library): lib/$(Package).c lib/$(Package)_defs.c
$(LINK.c) -o $@ $<
uninstall:
$(RM) $(HeaderDestination) $(LibraryDestination) $(LibraryDestinationWindows)