Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 38 lines (27 sloc) 0.825 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

DIR_INCLUDE = .
DIR_OBJECT = .
DIR_TARGET = .

HEADERS = atomic.h clock.h histogram.h queue.h
SOURCES = act.c clock.c histogram.c queue.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) $<

Something went wrong with that request. Please try again.