-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
41 lines (29 loc) · 849 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
40
41
MAKE_DIR := $(PWD)
TEST_DIR := $(MAKE_DIR)/src/test
EXAMPLE_DIR := $(MAKE_DIR)/example
DEPS = src/cvec.h src/vclock/vclock.h src/mpack/mpack.h
SOURCES := $(patsubst %.h,%.c, $(DEPS))
OBJECTS := $(patsubst %.h,%.o, $(notdir $(DEPS)))
CC = gcc
CFLAGS += -c -Wextra -Wall -Wall -Wshadow -Wpointer-arith -Wcast-qual
CFLAGS += -std=c11 -pedantic
# CFLAGS += -Wstrict-prototypes -Wmissing-prototypes
LDFLAGS :=
export MAKE_DIR CC CFLAGS LDFLAGS
all:
# @$(MAKE) -C $(TEST_DIR) # Temporarily disabled
@$(MAKE) -C $(EXAMPLE_DIR)
.PHONY: clean
clean:
#@$(MAKE) -C $(TEST_DIR) clean
@$(MAKE) -C $(EXAMPLE_DIR) clean
lib: libcvec.a
cvec.o: src/cvec.c $(DEPS)
@$(CC) $(CFLAGS) $(SOURCES)
libcvec.a: cvec.o
@ar rcs src/libcvec.a $(OBJECTS)
@ranlib src/libcvec.a
@rm -f *.o
@rm -f src/*.gch
libclean:
@rm -f *.o *.a src/*.o src/*.gch