branch: externals/pq commit 8e13d07737308d8ab134e50c869153f1743f286a Author: Mario Rodas <mar...@users.noreply.github.com> Commit: Mario Rodas <mar...@users.noreply.github.com>
Update Makefile --- Makefile | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 1b412527b0..e61c75dc8e 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,20 @@ +CC = gcc +CFLAGS = -I$(HOME)/ext/emacs/src/ -I /usr/include/postgresql/ -std=gnu99 -ggdb3 -Wall -fPIC +LDFLAGS = -lpq -CFLAGS = -I$(HOME)/ext/emacs/src/ -I /usr/include/postgresql/ -LDFLAGS = -lpq -pq.so : pq.c - gcc -g -O3 -shared $(CFLAGS) -Wall -Werror $(LDFLAGS) $< -o $@ +ifeq ($(OS),Windows_NT) +TARGET = pq.dll +else +TARGET = pq.so +endif + +all: $(TARGET) + +%.so: %.o + $(LD) -shared $(LDFLAGS) -o $@ $< + +%.o: %.c + $(CC) $(CFLAGS) -c $< clean: - rm -f pq.so + $(RM) $(TARGET)