summaryrefslogblamecommitdiffstats
path: root/Makefile
blob: 8272d2c1d1154b28720c2c9ea2d54fafd6d79469 (plain) (tree)
1
2
3
4
5
6
7
8
9








                               


                                         
                                                               
























                                                                              
TARGET:=libts3db_own.so
TOP:=.

headers:=$(wildcard ${TOP}/*.h)
sources:=$(wildcard ${TOP}/*.c)
deps:=$(sources:.c=.d)
objects:=$(sources:.c=.o)


#32BIT=-m32
CFLAGS=-fPIC $(32BIT) -g -std=c99
CFLAGS+=-I$(shell pg_config --includedir)
LDFLAGS=-shared -Wl,-soname,$(TARGET) $(32BIT) -lpq -liniparser

##############################################################################

.PHONY:	all clean

all:	$(TARGET)

clean:
	-$(RM) -r $(TARGET) $(objects) $(deps)

ifneq ($(MAKECMDGOALS),clean)
-include $(deps)
endif

##############################################################################
# normal build

$(TARGET):	$(objects) $(deps)
	$(CC) $(LDFLAGS) -o $(TARGET) $(objects)

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

%.d:		%.c
	$(CC) $(CFLAGS) -MM -c $< -MF $@