forked from kylehuff/buildcrx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (39 loc) · 886 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
35
36
37
38
39
40
41
42
43
44
45
ifneq (,$(findstring mingw,$(CC)))
OS = Windows_NT
endif
ifeq ($(OS),Windows_NT)
DISTDIR=winnt_x86-msvc
EXT=.exe
else
LBITS := $(shell getconf LONG_BIT)
ifeq ($(LBITS),64)
DISTDIR=linux_x86_64-gcc3
else
DISTDIR=linux_x86-gcc3
endif
EXT=
endif
OUTDIR=bin
LIBDIR=libs/openssl/${DISTDIR}
INCLUDE=include/openssl
CFLAGS = -L ${LIBDIR} -I ${INCLUDE} -g -Wall
ifeq ($(OS),Windows_NT)
LDFLAGS = -lm -DDEBUG -lcrypto -lgdi32
else
LDFLAGS = -lm -DDEBUG -lcrypto -ldl
endif
buildcrx : buildcrx.c
@set -e; if [ ! -d "${OUTDIR}/${DISTDIR}" ]; then \
mkdir -vp ${OUTDIR}/${DISTDIR}; \
fi
$(CC) $(CFLAGS) -o ${OUTDIR}/${DISTDIR}/buildcrx${EXT} buildcrx.c $(LDFLAGS)
clean:
@set -e; echo "cleaning output directories...";
@set -e; for d in $(OUTDIR)/*; do \
for f in $$d/*; do \
if [ -e "$$f" ]; then \
rm -v $$f; \
fi; \
done; \
done
@set -e; echo "done.";