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

Vladislav Rykov's avatar
Vladislav Rykov committed
3
INCLUDES 	= -I/usr/include/postgresql
Vladislav Rykov's avatar
Vladislav Rykov committed
4
5
6
7
8
LFLAGS 		= -Llib

LDIR		= lib
LIBS 		= $(LDIR)/gateway_protocol/gateway_protocol

Vladislav Rykov's avatar
Vladislav Rykov committed
9
LIBD		= -pthread -lpq
Vladislav Rykov's avatar
Vladislav Rykov committed
10
11
12
13
14
15
16
17
18
19
20

SRC 		= src/gateway.c

OBJ 		= obj

MAIN 		= gateway

.PHONY: depend clean

$(LDIR)/gateway_protocol/gateway_protocol.o:
	$(CC) -c $(LIBS)/gateway_protocol.c -o $(OBJ)/gateway_protocol.o -I$(LIBS)
Vladislav Rykov's avatar
Vladislav Rykov committed
21
	$(CC) $(SRC) $(OBJ)/gateway_protocol.o -o $(MAIN) -I$(LIBS) $(LIBD) $(INCLUDES)
Vladislav Rykov's avatar
Vladislav Rykov committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39


all: $(MAIN)
	@echo Compiling gateway project

$(MAIN): $(OBJ)/gateway_protocol.o
	$(CC) $(CFLAGS) $(INCLUDES) -o $(MAIN) $(OBJS) $(LFLAGS) $(LIBS)

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

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

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

# line needed by makedepend