-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (32 loc) · 872 Bytes
/
Makefile
File metadata and controls
44 lines (32 loc) · 872 Bytes
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
38
39
40
41
42
43
44
LDFLAGS := -L$(shell pg_config --libdir) -lpq
CFLAGS := -O2 -Wall -Werror
INCLUDES := -I$(shell pg_config --includedir)
PGLISTEN_SOURCES := pglisten.c
PGLISTEN_OBJS := $(PGLISTEN_SOURCES:%.c=%.o)
PGLATER_SOURCES := pglater.c
PGLATER_OBJS := $(PGLATER_SOURCES:%.c=%.o)
.PHONY: all
all: pglisten pglater
.PHONY: clean
clean: pglisten_clean pglater_clean
rm -f *~
.PHONY: distclean
distclean: clean
rm -f pglisten pglater
.PHONY: install
install: all
@echo "There's no installation target."
@echo "Just copy pglisten and pglater to wherever you need them."
.PHONY: pglisten_clean
pglisten_clean:
rm -f $(PGLISTEN_OBJS)
pglisten: $(PGLISTEN_OBJS)
$(CC) $< $(LDFLAGS) -o $@
pglisten.o: pglisten.c
pglater: $(PGLATER_OBJS)
$(CC) $< $(LDFLAGS) -o $@
.PHONY: pglater_clean
pglater_clean:
rm -f $(PGLATER_OBJS)
%.o: %.c
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@