-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (26 loc) · 922 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
32
33
34
35
36
CC = gcc
LISTS_SRC = $(wildcard src/Lists/*.c)
STACK_DEMOS_SRC = $(wildcard src/Demos/Stack/*.s)
LISTS_OBJ = $(patsubst src/Lists/%.c, build/Lists/%.o, $(LISTS_SRC))
OBJS = $(shell find build -type f -name '*.o')
build/%.o: src/%.c
$(CC) -c $< -o $@
folders:
mkdir -p build/Lists
mkdir -p build/Demos/Stack
mkdir -p build/Tests
build/Tests/ListTests.o: $(LISTS_OBJ)
build/StackTest.o: build/Demos/Stack/HanoiTower.o
build/Demos/Stack/HanoiTower.o: build/Lists/KNDS_Stack.o
build/Lists/KNDS_Stack.o: build/Lists/KNDS_List.o
build/Lists/KNDS_Queue.o: build/Lists/KNDS_List.o
all: folders build/StackTest.o
gcc build/StackTest.o \
build/Demos/Stack/HanoiTower.o \
build/Lists/KNDS_Stack.o \
build/Lists/KNDS_List.o \
-o release/StackTest
tests: folders build/Tests/ListTests.o
gcc -g -O1 build/Tests/ListTests.o $(LISTS_OBJ) -o tests/ListTests
clean:
rm -rf ./build/*