forked from Loures/objstore_sol
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (37 loc) · 1.31 KB
/
Copy pathMakefile
File metadata and controls
56 lines (37 loc) · 1.31 KB
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
CPPFLAGS=-I. -D_POSIX_C_SOURCE=200809L
LIBNAME=objstore
CFLAGS=-std=c99 -Wall
SHELL=/usr/bin/env bash
SRV_OBJECTS=worker.o dispatcher.o myhash.o os_client.o fs.o
default_target: all
myhash.o: myhash.c myhash.h
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
dispatcher.o: dispatcher.c dispatcher.h
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
worker.o: worker.c worker.h
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
fs.o: fs.c fs.h
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
os_client.o: os_client.c os_client.h
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
os_server: $(SRV_OBJECTS) os_server.h
$(CC) $(CFLAGS) -O3 $(CPPFLAGS) $(SRV_OBJECTS) os_server.c -o $@ -lpthread
lib$(LIBNAME).a: $(LIBNAME).o $(LIBNAME).h
$(AR) rcs $@ $<
client: client.c libobjstore.a
$(CC) $(CFLAGS) -L. $(CPPFLAGS) -DERRSTR=objstore_errstr $< -o $@ -l$(LIBNAME)
interactive: interactive.c libobjstore.a
$(CC) $(CFLAGS) -L. $(CPPFLAGS) -DERRSTR=objstore_errstr $< -o $@ -l$(LIBNAME) -lreadline
bigblock: bigblock.c libobjstore.a
$(CC) $(CFLAGS) -L. $(CPPFLAGS) -DERRSTR=objstore_errstr $< -o $@ -l$(LIBNAME)
all: os_server libobjstore.a client
testing: CFLAGS+=-g
testing: all
test: cleardata
@./os_server &
@./testscript.sh 50
clean:
$(RM) ./*.o ./os_server client libobjstore.a interactive bigblock
cleardata:
@$(RM) -r data/*
.PHONY: clean test cleardata