-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
38 lines (30 loc) · 691 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
# Makefile
# bushaofeng. 2011.8.27
# ver=1.0.0
CC=gcc
PP=g++
LIB=-lpthread
INCLDIR = ./
FPIC = -fPIC
WARN_LEVL = -Wall
FDEBUG = -g
SHARED = -shared
#STD_MODE = -std=c99
STD_MODE = -std=gnu99
EXTRA_OPT = $(FDEBUG)
EXTRA_OPT += $(WARN_LEVL)
EXTRA_OPT += $(FPIC)
EXTRA_OPT += $(STD_MODE)
#EXTRA_OPT += $(SHARED)
#EXTRA_OPT += $(STD_MODE)
OBJDIR = .
SRCS = $(wildcard $(OBJDIR)/*.c)
OBJS = $(patsubst %.c,%.o,$(SRCS))
TARGET=libbs.a
$(TARGET):$(OBJS)
echo $(OBJS)
ar -r libbs.a $(OBJS)
$(OBJS):%.o: %.c
$(CC) -c $(LDFLAGS) $(EXTRA_OPT) -I$(INCLDIR) $^ -o $@
clean:
rm -rf *.a *.o