-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (29 loc) · 771 Bytes
/
Makefile
File metadata and controls
39 lines (29 loc) · 771 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
37
38
39
# Makefile for main.c
# 2019-11-12
# 350137278@qq.com
#
# show all predefinitions of gcc:
#
# $ gcc -E -dM - </dev/null
###########################################################
# change version[] in main.c by below version:
PREFIX = .
all: main
CC=gcc
CFLAGS=-D_GNU_SOURCE
threadpool.o: $(PREFIX)/src/threadpool.c
$(CC) $(CFLAGS) -c $(PREFIX)/src/threadpool.c -o $@
main.o: $(PREFIX)/src/main.c
$(CC) $(CFLAGS) -c $(PREFIX)/src/main.c -o $@
main: main.o threadpool.o
$(CC) -o $@ $(PREFIX)/threadpool.o \
$(PREFIX)/main.o \
-lpthread
clean:
-rm -f $(PREFIX)/threadpool.o
-rm -f $(PREFIX)/main.o
-rm -f $(PREFIX)/main
-rm -f $(PREFIX)/main.exe
check: all
@echo "**** ALL TESTS PASSED ****"
.PHONY: all clean