-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (26 loc) · 827 Bytes
/
Makefile
File metadata and controls
35 lines (26 loc) · 827 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
BN_LIBRARY=/home/poulter/Coding/C_C++/bignum/bin/shared
BN_INCLUDE=/home/poulter/Coding/C_C++/bignum/src/
CC=gcc
ROOT_PATH = $(abspath $(lastword $(MAKEFILE_LIST)))
SRC_DIR = $(dir $(ROOT_PATH))src
EX_DIR = $(dir $(ROOT_PATH))bin
EX_NAME = myssh
ifeq ($(RELEASE),1)
COMPILE_FLAGS = -O3 -w
endif
ifeq ($(DEBUG),1)
COMPILE_FLAGS = -Og -g -Wall
endif
SRCS = $(wildcard $(SRC_DIR)/*.c)
OBJS = $(patsubst $(SRC_DIR)/%.c,$(EX_DIR)/%.o,$(SRCS))
DEPS = $(wildcard $(SRC_DIR)/*.h)
LDFLAGS=-L$(BN_LIBRARY) -lm -lreadline -lpthread -lbignum
CFLAGS=$(COMPILE_FLAGS) -I$(BN_INCLUDE) -DUSE_BIGNUM
$(EX_NAME): $(EX_DIR)/$(EX_NAME)
$(EX_DIR)/$(EX_NAME): $(OBJS) $(DEPS)
$(CC) $^ -o $@ $(CFLAGS) $(LDFLAGS)
$(OBJS): $(EX_DIR)/%.o : $(SRC_DIR)/%.c $(DEPS)
$(CC) -c $< -o $@ $(CFLAGS)
.PHONY: clean
clean:
rm -f bin/*.o bin/myssh