forked from aerospike/act
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makesalt
37 lines (27 loc) · 783 Bytes
/
Makesalt
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 = random.h
SOURCES = salt.c random.c
TARGET = actprep
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) $<