-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.test
65 lines (50 loc) · 1.19 KB
/
Makefile.test
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
59
60
61
62
63
64
65
# Makefile for 'libdes'
# ----------------------------------------------------------------------
# Written by Raphael Kim
#
GCC = gcc
GPP = g++
AR = ar
# Base PATH
BASE_PATH = .
LIB_PATH = $(BASE_PATH)/lib
SRC_PATH = $(BASE_PATH)/test
# TARGET settings
TARGET_PKG = destest
TARGET_DIR = ./bin/Release
TARGET_OBJ = ./obj/Release
# DEFINITIONS
DEFS =
# Compiler options
COPTS = -O3 -s
# CC FLAG
CFLAGS = -I$(SRC_PATH)
CFLAGS += -I$(LIB_PATH)
CFLAGS += $(DEFS)
CFLAGS += $(COPTS)
# LINK FLAG
LFLAGS = -static
LFLAGS += -L$(LIB_PATH)
LFLAGS += -ldes
# Sources ( for any cpp )
SRCS = $(SRC_PATH)/destool.cpp
# Make object targets from SRCS.
OBJS = $(SRCS:$(SRC_PATH)/%.cpp=$(TARGET_OBJ)/%.o)
.PHONY: prepare clean
all: prepare clean continue
continue: $(TARGET_DIR)/$(TARGET_PKG)
prepare:
@mkdir -p $(TARGET_DIR)
@mkdir -p $(TARGET_OBJ)
clean:
@echo "Cleaning built targets ..."
@rm -rf $(TARGET_DIR)/$(TARGET_PKG)
@rm -rf $(TARGET_DIR)/*.h
@rm -rf $(TARGET_OBJ)/*.o
$(OBJS): $(TARGET_OBJ)/%.o: $(SRC_PATH)/%.cpp
@echo "Compiling $@ ... "
@$(GPP) $(CFLAGS) -c $< -o $@
$(TARGET_DIR)/$(TARGET_PKG): $(OBJS)
@echo "Generating $@ ..."
@$(GPP) $(CFLAGS) $(OBJS) $(LFLAGS) -o $@
@echo "done."