-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (34 loc) · 1.13 KB
/
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
DEBUG_FLAG = -D_NDEBUG -D_DEBUG_PRINT -D_Q_DEBUG
COBJS = main.o lwt.o dlinkedlist.o ring_queue.o
CFLAGS = -O3 -I. -Wall -Wextra -std=gnu99 -lpthread
#CFLAGS = -g -I. -Wall -Wextra -std=gnu99
CC = gcc
AOBJS = lwt_trampoline.o
AFLAGS =
AS = gcc
BIN = test
BFLAGS = -O3 -I. -Wall -Wextra -std=gnu99 -lpthread
#BFLAGS = -g -I. -Wall -Wextra -std=gnu99
LD = ld
all: $(BIN)
$(COBJS) : %.o : %.c
# $(info ********** Start making project **********)
# $(info --> Compiling C objs...)
$(CC) $(CFLAGS) $(DEBUG_FLAG) -o $@ -c $<
# $(info --> C objs generated...)
$(AOBJS) : %.o : %.s
# $(info --> Compiling assembly objs...)
$(AS) $(AFLAGS) -o $@ -c $<
# $(info --> Assembly objs generated...)
$(BIN): $(COBJS) $(AOBJS)
# $(info --> Linking objects...)
$(CC) $(BFLAGS) $(DEBUG_FLAG) -o $(BIN) $^
rm -rf $(COBJS) $(AOBJS)
# $(info --> Finished, run ./$(BIN) to start.)
# $(info ********** End of making project **********)
clean:
# $(info ********** Start cleaning project **********)
# $(info --> Cleaning projects...)
rm -rf $(BIN) $(COBJS) $(AOBJS)
# $(info --> Projects cleaned.)
# $(info ********** End of cleaning project **********)