
libcurl_dll_LIBRARY = libcurl.dll
libcurl_dll_a_LIBRARY = libcurl.dll.a

LIBCURL_OBJECTS := $(patsubst %.c,%.o,$(strip $(CSOURCES)))

RESOURCE = libcurl.res

RC = windres

all-local: $(libcurl_dll_LIBRARY)


$(libcurl_dll_LIBRARY): $(LIBCURL_OBJECTS) $(RESOURCE) $(libcurl_dll_DEPENDENCIES)
	@$(call DEL, $@)
	$(CC) $(LDFLAGS) -shared -o $@ \
	  -Wl,--output-def,$(@:.dll=.def),--out-implib,$(libcurl_dll_a_LIBRARY) \
	  $(LIBCURL_OBJECTS) $(RESOURCE) $(LIBCURL_LIBS)

%.o: %.c $(PROOT)/include/curl/curlbuild.h
	$(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@

%.res: %.rc
	$(RC) $(RCFLAGS) -i $< -o $@
