-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (28 loc) · 865 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
TOOLS = readself pupunpack unself sceverify scekrit
TOOLS += makeself norunpack puppack unpkg pkg unspp
TOOLS += cosunpkg cospkg ungpkg
TOOLS += unspp
COMMON = tools.o aes.o sha1.o ec.o bn.o
DEPS = Makefile tools.h types.h
OSNAME = $(shell uname -s)
ifeq ($(findstring MINGW, $(OSNAME)), MINGW)
COMMON += mingw_mmap.o
endif
CC = gcc
CFLAGS = -g -O2 -Wall -W
LDLIBS = -lz
# Darwin's MacPorts Default Path
ifeq ($(shell test -e /opt/local/include/gmp.h; echo $$?),0)
CFLAGS += -I/opt/local/include
LDLIBS += -L/opt/local/lib
endif
OBJS = $(COMMON) $(addsuffix .o, $(TOOLS))
all: $(TOOLS)
$(TOOLS): %: %.o $(COMMON) $(DEPS)
$(CC) $(CFLAGS) -o $@ $< $(COMMON) $(LDLIBS)
scekrit: %: %.o $(COMMON) $(DEPS)
$(CC) $(CFLAGS) -o $@ $< $(COMMON) $(LDLIBS) -lgmp
$(OBJS): %.o: %.c $(DEPS)
$(CC) $(CFLAGS) -c -o $@ $<
clean:
-rm -f $(OBJS) $(TOOLS) *.exe