-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (29 loc) · 876 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
SRCS = mutex.c mypthread_queue.c mypthread.c mypthread_utilities.c mypthread_wrapper.c warrior.c battlefield.c kbhit.c deck.c
INC = mutex.h mutex_inline.h mutex_assam.h mypthread.h mypthread_queue.h kbhit.h warrior.h
OBJS = $(SRCS:.c=.o)
TEST_SRCS = ejemplo.c
TEST_OBJS = $(TEST_SRCS:.c=.o)
#DEBUG=0
CFLAGS = -Wall -Werror -I. -g
LDFLAGS = -L.
LIB = libmythread.a
AR = /usr/bin/ar
CC = gcc
#ifeq ($(DEBUG),1)
#EXTRA_CFLAGS += -DDEBUG
#endif
.PHONY: all lib clean tags test a5
a5: all
all: lib test
lib: $(LIB)
libmythread.a: $(OBJS) $(INC)
$(AR) rcs $(LIB) $(OBJS)
%.o: %.c $(INC)
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c $< -o $@
clean:
rm -f $(OBJS) $(TEST_OBJS) $(LIB) *~ tec-royale
tags:
find . -name "*.[cChH]" | xargs ctags
find . -name "*.[cChH]" | etags -
test: $(TEST_OBJS) $(INC) lib
$(CC) -o tec-royale $(CFLAGS) $(EXTRA_CFLAGS) $(TEST_OBJS) $(LIB)