-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathmakefile
More file actions
50 lines (38 loc) · 755 Bytes
/
makefile
File metadata and controls
50 lines (38 loc) · 755 Bytes
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
# (!c) petter wahlman
#
CC = gcc
SRCDIR = ./src
OBJDIR = ./obj
BINDIR = ./bin
INCLUDE = ./include
BINARY = $(BINDIR)/kcache
CFLAGS = -I $(INCLUDE) -g -Wall
LDFLAGS = -lcrypto
VPATH = $(SRCDIR)
BINARY_OBJ = \
$(OBJDIR)/kcache.o \
$(OBJDIR)/crypto.o \
$(OBJDIR)/util.o \
$(OBJDIR)/lzss.o
$(OBJDIR)/%.o: %.c
$(CC) -c $< $(CFLAGS) -o $@
.PHONY:
all: make_dirs $(BINARY) install
$(BINARY): $(BINARY_OBJ)
$(CC) -o $@ $^ $(LDFLAGS)
.PHONY:
clean:
@rm -rvf \
$(BINARY) \
$(BINARY_OBJ)
@-ls ./kcache/*kernelcache.* |grep -v release | xargs rm -v
.PHONY:
make_dirs:
@mkdir -p $(OBJDIR) $(BINDIR)
.PHONY:
install:
@if [ -d ~/bin ]; then \
install $(BINARY) ~/bin; \
else \
sudo install $(BINARY) /usr/local/bin; \
fi