File: Makefile.win32

package info (click to toggle)
libpqtypes 1.5.1-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,100 kB
  • sloc: sh: 8,334; ansic: 7,601; makefile: 71
file content (49 lines) | stat: -rwxr-xr-x 1,379 bytes parent folder | download | duplicates (4)
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
45
46
47
48
49
##############################################################
# Project: libpqtypes
# Makefile for Cygwin or Mingw Environments (GCC)
#
# make -f Makefile.win32 [options] [targets]
#
# For further build instructions, see the package's INSTALL file.
#
# Authors: Andrew Chernow, Merlin Moncure
# Contact: libpqtypes@esilo.com
##############################################################

PROJNAME = libpqtypes

DEPS = src/libpqtypes-int.h src/libpqtypes.h
OBJECTS = src/array.o src/datetime.o src/error.o \
	src/events.o src/exec.o src/geo.o src/handler.o \
	src/misc.o src/network.o src/numerics.o \
	src/param.o src/port.o src/record.o src/spec.c \
	src/utils.o src/varlena.o

INC += -Isrc
LIBS = -lpq -lws2_32
CFLAGS += -s -Wall -Wpointer-arith -D_GNU_SOURCE -O3 \
	-std=gnu99 -Wlong-long -D_WIN32_WINNT=0x0501 -D_REENTRANT

ifdef MT
	CFLAGS += -DPQT_THREAD_SAFE -D_THREAD_SAFE
	LIBS += -lpthread
endif

ifdef PQT_LONG_LONG
	CFLAGS += -DPQT_LONG_LONG=$(PQT_LONG_LONG)
endif

all: $(OBJECTS)
	dllwrap -o $(PROJNAME).dll -dllname $(PROJNAME).dll $(OBJECTS) $(LPATH) $(LIBS)
	dlltool --dllname $(PROJNAME).dll --output-lib $(PROJNAME).a

test:
	gcc $(CFLAGS) $(INC) -o regtest src/regression-test.c $(PROJNAME).dll $(LPATH) $(LIBS)
	-@rm -f regression-test.o

%.o: %.c $(DEPS)
	gcc $(CFLAGS) $(INC) -o $@ -c $<

clean:
	-@rm -f $(OBJECTS) $(PROJNAME).so $(PROJNAME).a regtest