-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (26 loc) · 830 Bytes
/
Makefile
File metadata and controls
36 lines (26 loc) · 830 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
SHELL = bash
DEPEND = $() Try
DLL_BIN = ../Bin
BIN = Bin
SOURCE = Source/*.c
TESTS = Tests/*.c
NAME = CollectionsPlus
DLL := $(DLL_BIN)/lib$(NAME).dll
TESTS_EXE := $(BIN)/Tests.exe
RUN := $(TESTS_EXE)
HEADERS_WILDCARD = ../*/Header
HEADERS := $(subst $() , -I , $(wildcard $(HEADERS_WILDCARD)))
Debug: COMPILE_FLAGS = -g
Debug: Compile
Release: COMPILE_FLAGS = -s
Release: Compile
Debugger: RUN = gdb $(TESTS_EXE)
Debugger: Debug
Compile: $(DLL) $(TESTS_EXE)
$(RUN)
$(DLL): $(SOURCE) $(HEADERS_WILDCARD)/*.h
gcc $(COMPILE_FLAGS) -fPIC -shared $(SOURCE) $(HEADERS) -L$(DLL_BIN) $(subst $() , -l,$(DEPEND)) -o $(DLL)
$(TESTS_EXE): $(DLL) $(TESTS) $(HEADERS_WILDCARD)/*.h
gcc $(COMPILE_FLAGS) $(TESTS) $(HEADERS) -L $(DLL_BIN) -l$(NAME) -o $(TESTS_EXE)
Clean:
rm $(TESTS_EXE) $(DLL)