-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakeFile
31 lines (24 loc) · 912 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
BIN = Bin
TEMP = Temp
SOURCE = Source
TESTS = Tests
MAIN_NAME = Main
NAME = Sectional
TESTS_NAME = Tests
SECTION_LOADER_NAME = SectionLoader
Debug: ClearBin Sectional Main Test Run
Release: ClearBin Sectional Main
ClearBin:
(cd $(BIN) && del /q $(NAME).exe lib$(TESTS_NAME).dll lib$(NAME).dll)
Sectional:
gcc -fPIC -c $(SOURCE)/$(SECTION_LOADER_NAME).c -o $(TEMP)/$(SECTION_LOADER_NAME).o
gcc -fPIC -c $(SOURCE)/$(NAME).c -o $(TEMP)/$(NAME).o
gcc -s -shared $(TEMP)/$(SECTION_LOADER_NAME).o $(TEMP)/$(NAME).o -o $(BIN)/lib$(NAME).dll
Main:
gcc -c $(SOURCE)/$(MAIN_NAME).c -o $(TEMP)/$(MAIN_NAME).o
gcc -s -L$(BIN) -l$(NAME) $(TEMP)/$(MAIN_NAME).o -o $(BIN)/$(NAME).exe
Test:
gcc -fPIC -c -o $(TEMP)/lib$(TESTS_NAME).o $(TESTS)/$(TESTS_NAME).c
gcc -s -shared -L$(BIN) -l$(NAME) $(TEMP)/lib$(TESTS_NAME).o -o $(BIN)/lib$(TESTS_NAME).dll
Run:
(cd $(BIN) && $(NAME).exe)