-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (30 loc) · 856 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
37
38
39
40
41
42
43
44
BINARIES := T1_hello_thread T2_resume_test T3_lock_test T4_uthread_demo test1 test2 uthread_demo
all: $(BINARIES)
OBJ = uthread.o
LIB = uthread.h
CC =gcc
CFLAGS = -Wall -g
# Clean Up Objects, Executables, Dumps out of source directory
.PHONY: clean
clean:
rm -f *.o $(BINARIES)
tags:
etags *.h *.c *.cpp
%.o: %.cpp
g++ -c $(CFLAGS) $< -o $@
%.o: %.c
$(CC) -c $(CFLAGS) $< -o $@
T1_hello_thread: T1_hello_thread.c $(OBJ) $(LIB)
$(CC) $(CFLAGS) $^ -o $@
T2_resume_test: T2_resume_test.c $(OBJ) $(LIB)
$(CC) $(CFLAGS) $^ -o $@
T3_lock_test: T3_lock_test.c $(OBJ) $(LIB)
$(CC) $(CFLAGS) $^ -o $@
T4_uthread_demo: T4_uthread_demo.c $(OBJ) $(LIB)
$(CC) $(CFLAGS) $^ -o $@
test1: test1.cpp $(OBJ) $(LIB)
g++ $(CFLAGS) $^ -o $@
test2: test2.cpp $(OBJ) $(LIB)
g++ $(CFLAGS) $^ -o $@
uthread_demo: uthread_demo.c
$(CC) $(CFLAGS) $^ -o $@