forked from tin2tin/drmdecrypt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (51 loc) · 1.16 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#
# This Makefile requires GNU Make
#
CC ?= cc
CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
# add git revision if .git exists
ifeq (,$(wildcard .git))
CFLAGS += -DREVISION="unknown"
else
CFLAGS += -DREVISION="$(shell git rev-parse --short HEAD)"
endif
# general optimizations
CFLAGS += -Ofast
# platform/arch specifics
UNAME_S := $(shell uname -s)
UNAME_M := $(shell uname -m)
ifeq ($(OS),Windows_NT)
# malloc implementation and link to libc/msvcrt
CFLAGS += -DHAVE__ALIGNED_MALLOC
LDFLAGS += -lmsvcrt
# aesni
CFLAGS += -maes -march=native
SRC += AESNI.c
endif
ifeq ($(UNAME_S),Linux)
CFLAGS += -DHAVE_POSIX_MEMALIGN
LDFLAGS += -lc -static
ifeq ($(UNAME_M),x86_64)
CFLAGS += -maes -march=native
SRC += AESNI.c
endif
endif
ifeq ($(UNAME_S),FreeBSD)
CFLAGS += -DHAVE_POSIX_MEMALIGN
LDFLAGS += -lc -static
ifeq ($(UNAME_M),amd64)
CFLAGS += -maes -march=native
SRC += AESNI.c
endif
endif
ifeq ($(UNAME_S),Darwin)
CFLAGS += -DHAVE_POSIX_MEMALIGN
LDFLAGS += -lc
endif
##########################
SRC += AES.c buffer.c drmdecrypt.c
OBJS = $(SRC:.c=.o)
all: drmdecrypt
drmdecrypt: $(OBJS)
clean:
rm -f *.o *.core drmdecrypt drmdecrypt.exe