-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (39 loc) · 687 Bytes
/
Makefile
File metadata and controls
46 lines (39 loc) · 687 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
40
41
42
43
44
45
46
CC=gcc
UNAME:= $(shell uname)
NAME=libtca.a
CFLAGS=-O3 -g -I.
OBJSDIR=build
SRCS= \
utils.c \
myaml.c \
hashtable.c \
vector.c \
intmap.c \
iterator.c \
dynarray.c \
OBJS=$(addprefix $(OBJSDIR)/,$(SRCS:.c=.o))
DEPS= \
myaml.h \
utils.h \
hashtable.h \
vector.h \
intmap.h \
iterator.h \
dynarray.h \
Makefile \
all: $(NAME)
$(OBJSDIR):
mkdir $(OBJSDIR)
$(NAME): $(OBJS)
ifeq ($(UNAME), Darwin)
libtool -static -o $(NAME) $(OBJS)
endif
ifeq ($(UNAME), Linux)
ar rcs $(NAME) $(OBJS)
endif
$(OBJS): $(OBJSDIR)/%.o: %.c $(DEPS) | $(OBJSDIR)
$(CC) -c $(CFLAGS) $< -o $@
fclean: clean
rm -f $(NAME)
clean:
rm -f $(OBJS)