Makefile 991 Bytes
Newer Older
Vladislav Rykov's avatar
Vladislav Rykov committed
1
2
CC 		= gcc

3
INCLUDES 	= -I/usr/include/postgresql -I$(LDIR)/gateway_protocol -I$(LDIR)/base64 -I$(LDIR)/task_queue
Vladislav Rykov's avatar
Vladislav Rykov committed
4
5
6
LFLAGS 		= -Llib

LDIR		= lib
Vladislav Rykov's avatar
Vladislav Rykov committed
7
LIBD		= -pthread -lpq
Vladislav Rykov's avatar
Vladislav Rykov committed
8
9
10
11
12
13
14
15
16
17

SRC 		= src/gateway.c

OBJ 		= obj

MAIN 		= gateway

.PHONY: depend clean

$(LDIR)/gateway_protocol/gateway_protocol.o:
18
19
20
21
	$(CC) -c $(LDIR)/gateway_protocol/gateway_protocol.c -o $(OBJ)/gateway_protocol.o -I$(LDIR)/gateway_protocol
	$(CC) -c $(LDIR)/base64/base64.c -o $(OBJ)/base64.o -I$(LDIR)/base64
	$(CC) -c $(LDIR)/task_queue/task_queue.c -o $(OBJ)/task_queue.o -I$(LDIR)/task_queue
	$(CC) $(SRC) $(OBJ)/gateway_protocol.o $(OBJ)/base64.o $(OBJ)/task_queue.o -o $(MAIN) $(LIBD) $(INCLUDES)
Vladislav Rykov's avatar
Vladislav Rykov committed
22
23
24
25
26


all: $(MAIN)
	@echo Compiling gateway project

27
28
$(MAIN): $(OBJ)/gateway_protocol.o $(OBJ)/base64.o $(OBJ)/task_queue.o
	$(CC) $(CFLAGS) $(INCLUDES) -o $(MAIN) $(OBJS) $(LFLAGS)
Vladislav Rykov's avatar
Vladislav Rykov committed
29
30
31
32
33
34
35
36
37
38
39

.c.o:
	$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@

clean:
	$(RM) *.o *~ $(MAIN)

depend: $(SRCS)
	makedepend $(INCLUDES) $^

# line needed by makedepend