-
Notifications
You must be signed in to change notification settings - Fork 48
/
Makefile
executable file
·58 lines (45 loc) · 1.33 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
PRODUCTION := 0
PRODUCTION_VERSION := 6.2.1
PRODUCTION_YEAR := 2024
ifeq ($(PRODUCTION),1)
VERSION_TAG := $(PRODUCTION_VERSION)
else
VERSION_TAG := $(shell git describe --tags || echo $(PRODUCTION_VERSION))
endif
VERSION_YEAR := $(shell echo $(PRODUCTION_YEAR))
PREFIX ?=/usr/local
INSTALLDIR = $(DESTDIR)$(PREFIX)/bin
HOSTOS := $(shell uname -s)
CC ?= gcc
CFLAGS ?= -O3 -Wall -Wextra
CFLAGS += -std=gnu99
DEFS = -DVERSION_TAG=\"$(VERSION_TAG)\" -DVERSION_YEAR=\"$(VERSION_YEAR)\"
INSTFLAGS = -m 0755
ifeq ($(HOSTOS), Linux)
INSTFLAGS += -D
endif
ifeq ($(HOSTOS), Darwin)
CFLAGS += -L/usr/local/opt/openssl/lib -I/usr/local/opt/openssl/include
endif
all: build
build:
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -o wlangenpmk wlangenpmk.c -lcrypto $(LDFLAGS)
ifeq ($(HOSTOS), Darwin)
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -o wlangenpmkocl wlangenpmkocl.c -lcrypto -Wl,-framework,OpenCL -lm $(LDFLAGS)
else
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -o wlangenpmkocl wlangenpmkocl.c -lcrypto -lOpenCL $(LDFLAGS)
endif
install: build
install $(INSTFLAGS) wlangenpmk $(INSTALLDIR)/wlangenpmk
install $(INSTFLAGS) wlangenpmkocl $(INSTALLDIR)/wlangenpmkocl
rm -f wlangenpmk
rm -f wlangenpmkocl
rm -f pwhash
rm -f *.o *~
clean:
rm -f wlangenpmk
rm -f wlangenpmkocl
rm -f *.o *~
uninstall:
rm -f $(INSTALLDIR)/wlangenpmk
rm -f $(INSTALLDIR)/wlangenpmkocl