Makefile 845 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
22
	$(CC) -c $(LDIR)/base64/base64.c -o $(OBJ)/base64.o -Ilib/base64
	$(CC) $(SRC) $(OBJ)/gateway_protocol.o $(OBJ)/base64.o -o $(MAIN) -I$(LIBS) -Ilib/base64 $(LIBD) $(INCLUDES)
Vladislav Rykov's avatar
Vladislav Rykov committed
23
24
25
26
27


all: $(MAIN)
	@echo Compiling gateway project

Vladislav Rykov's avatar
Vladislav Rykov committed
28
$(MAIN): $(OBJ)/gateway_protocol.o $(OBJ)/base64.o
Vladislav Rykov's avatar
Vladislav Rykov committed
29
30
31
32
33
34
35
36
37
38
39
40
	$(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