-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
81 lines (59 loc) · 2.33 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/make -f
SHELL = /bin/sh
objdir = build
bindir = bin
srcdir = src
libdir = lib
CC = gcc
CFLAGS = -Wall -Wextra -g -O2
LDFLAGS = -g -L $(libdir) -Wl,-rpath=$(libdir) -lbf
SRCS = $(shell find $(srcdir) -name "*.c")
OBJS = $(SRCS:.c=.o)
.PHONY: all
all: main1 main2 main3
tests: db RD_Split_Records ib insert insert2 insert3 insert4 insert5 insert6
main1: $(OBJS) examples/main1.o
$(CC) $(LDFLAGS) $(addprefix $(objdir)/, $(notdir $^)) -o $(bindir)/$@
main2: $(OBJS) examples/main2.o
$(CC) $(LDFLAGS) -o $(bindir)/$@ $(addprefix $(objdir)/, $(notdir $^))
main3: $(OBJS) examples/main3.o
$(CC) $(LDFLAGS) -o $(bindir)/$@ $(addprefix $(objdir)/, $(notdir $^))
db: $(OBJS) tests/main_test_DB.o
$(CC) $(LDFLAGS) -o $(bindir)/$@ $(addprefix $(objdir)/, $(notdir $^))
RD_Split_Records: $(OBJS) tests/test_RD_Split_Records.o
$(CC) $(LDFLAGS) -o $(bindir)/$@ $(addprefix $(objdir)/, $(notdir $^))
ib: $(OBJS) tests/test_indexblock.o
$(CC) $(LDFLAGS) -o $(bindir)/$@ $(addprefix $(objdir)/, $(notdir $^))
insert: $(OBJS) tests/test_AM_insert1.o
$(CC) $(LDFLAGS) -o $(bindir)/$@ $(addprefix $(objdir)/, $(notdir $^))
insert2: $(OBJS) tests/test_AM_insert2.o
$(CC) $(LDFLAGS) -o $(bindir)/$@ $(addprefix $(objdir)/, $(notdir $^))
insert3: $(OBJS) tests/test_AM_insert3.o
$(CC) $(LDFLAGS) -o $(bindir)/$@ $(addprefix $(objdir)/, $(notdir $^))
insert4: $(OBJS) tests/test_AM_insert4.o
$(CC) $(LDFLAGS) -o $(bindir)/$@ $(addprefix $(objdir)/, $(notdir $^))
insert5: $(OBJS) tests/test_AM_insert5.o
$(CC) $(LDFLAGS) -o $(bindir)/$@ $(addprefix $(objdir)/, $(notdir $^))
insert6: $(OBJS) tests/test_AM_insert6.o
$(CC) $(LDFLAGS) -o $(bindir)/$@ $(addprefix $(objdir)/, $(notdir $^))
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $(objdir)/$(notdir $@)
.PHONY: clean
clean:
rm -f $(objdir)/* $(bindir)/*
rm -f ./EMP-AGE ./EMP-SAL ./EMP-NAME ./EMP-DNAME ./EMP-FAULT
#main1:
# @echo " Compile main1 ...";
# gcc -L ./lib/ -Wl,-rpath,./lib/ ./examples/main1.c ./src/AM.c -lbf -o ./build/main1
#
#main2:
# @echo " Compile main2 ...";
# gcc -L ./lib/ -Wl,-rpath,./lib/ ./examples/main2.c ./src/AM.c -lbf -o ./build/main2
#
#main3:
# @echo " Compile main3 ...";
# gcc -L ./lib/ -Wl,-rpath,./lib/ ./examples/main3.c ./src/AM.c -lbf -o ./build/main3
#
#bf:
# @echo " Compile bf_main ...";
# gcc -I ./include/ -L ./lib/ -Wl,-rpath,./lib/ ./examples/bf_main.c -lbf -o ./build/runner -O2