forked from aerospike/act
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·37 lines (27 loc) · 835 Bytes
/
Makefile
File metadata and controls
executable file
·37 lines (27 loc) · 835 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
DIR_INCLUDE = .
DIR_OBJECT = .
DIR_TARGET = .
HEADERS = atomic.h clock.h histogram.h queue.h random.h
SOURCES = act.c histogram.c queue.c random.c
TARGET = act
CC = gcc
#CFLAGS = -g -O3 -fno-common -std=gnu99 -Wall -D_REENTRANT
CFLAGS = -g -fno-common -std=gnu99 -Wall -D_REENTRANT -D_FILE_OFFSET_BITS=64
CFLAGS += -MMD
LDFLAGS = $(CFLAGS)
INCLUDES = $(DIR_INCLUDE:%=-I%) -I/usr/include
LIBRARIES = -lpthread -lrt -lcrypto -lssl -lz
OBJECTS = $(SOURCES:%.c=$(DIR_OBJECT)/%.o)
DEPENDENCIES = $(OBJECTS:%.o=%.d)
default: $(TARGET)
.PHONY: clean
clean:
/bin/rm -f $(OBJECTS) $(DEPENDENCIES) $(TARGET)
.PHONY: $(TARGET)
$(TARGET): $(OBJECTS)
echo "Linking $@"
$(CC) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBRARIES)
-include $(DEPENDENCIES)
$(DIR_OBJECT)/%.o: %.c
echo "Building $@"
$(CC) $(CFLAGS) -o $@ -c $(INCLUDES) $<