# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/. 

DEPTH		= ../../../..
topsrcdir       = @top_srcdir@
srcdir          = @srcdir@
VPATH           = @srcdir@

include $(DEPTH)/config/autoconf.mk

OBJ_SUFF = o
LDFLAGS =
CFLAGS =
CC_BASE = $(shell basename $(CC))

ifeq ($(CC_BASE),clang)
LDFLAGS	+= -dynamiclib -install_name @executable_path/$(SHARED_LIBRARY) -compatibility_version 1 -current_version 1 -single_module
else
ifeq ($(CC_BASE),gcc)
LDFLAGS += -shared -Wl,-Bsymbolic
CFLAGS += -fPIC
else
$(error "Unknown compiler. please specify compiler and linker options (CFLAGS and LDFLAGS)")
endif
endif

ifeq ($(OS_ARCH),WINNT)
OBJ_SUFF = obj
endif

source = subprocess.c
objfiles = subprocess.$(OBJ_SUFF)
libname = $(DLL_PREFIX)subprocess$(DLL_SUFFIX)

all: libs

libs: source
	$(CC) $(LDFLAGS) -o $(libname) $(objfiles)

source: $(source)
	$(CC) $(CFLAGS) -c -o $(objfiles) $^


clean:
	rm -f $(objfiles) $(libname)

tools:

export:
