1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-10 11:35:07 -05:00

Rewritten to also produce a static library (libcurl_wc.lib).

This commit is contained in:
Gisle Vanem 2008-08-17 13:34:15 +00:00
parent fb8fe6f2b3
commit 68bb51c55b

View File

@ -4,7 +4,7 @@
# #
# $Id$ # $Id$
TARGETS = libcurl_wc.dll libcurl_wc_imp.lib TARGETS = libcurl_wc.dll libcurl_wc_imp.lib libcurl_wc.lib
CC = wcc386 CC = wcc386
@ -24,9 +24,10 @@ USE_ZLIB = 0
CFLAGS += -dHAVE_ZLIB_H -dHAVE_LIBZ -I$(ZLIB_ROOT) CFLAGS += -dHAVE_ZLIB_H -dHAVE_LIBZ -I$(ZLIB_ROOT)
!endif !endif
OBJ_DIR = WC_Win32.obj OBJ_BASE = WC_Win32.obj
C_ARG = $(OBJ_DIR)\wcc386.arg C_ARG = $(OBJ_BASE)\wcc386.arg
LINK_ARG = $(OBJ_DIR)\wlink.arg LINK_ARG = $(OBJ_BASE)\dyn\wlink.arg
LIB_ARG = $(OBJ_BASE)\stat\wlib.arg
OBJS = $(OBJ_DIR)\base64.obj $(OBJ_DIR)\connect.obj & OBJS = $(OBJ_DIR)\base64.obj $(OBJ_DIR)\connect.obj &
$(OBJ_DIR)\content_encoding.obj $(OBJ_DIR)\cookie.obj & $(OBJ_DIR)\content_encoding.obj $(OBJ_DIR)\cookie.obj &
@ -58,32 +59,52 @@ OBJS = $(OBJ_DIR)\base64.obj $(OBJ_DIR)\connect.obj &
$(OBJ_DIR)\timeval.obj $(OBJ_DIR)\transfer.obj & $(OBJ_DIR)\timeval.obj $(OBJ_DIR)\transfer.obj &
$(OBJ_DIR)\url.obj $(OBJ_DIR)\version.obj $(OBJ_DIR)\url.obj $(OBJ_DIR)\version.obj
RESOURCE = $(OBJ_DIR)\libcurl.res #
# Use $(OBJS) as a template to generate $(OBJS_STAT) and $(OBJS_DYN).
#
OBJ_DIR = $(OBJ_BASE)\stat
OBJS_STAT = $+ $(OBJS) $-
all: $(OBJ_DIR) $(C_ARG) $(TARGETS) .SYMBOLIC OBJ_DIR = $(OBJ_BASE)\dyn
OBJS_DYN = $+ $(OBJS) $-
RESOURCE = $(OBJ_BASE)\dyn\libcurl.res
all: $(OBJ_BASE) $(C_ARG) $(TARGETS) .SYMBOLIC
@echo Welcome to libcurl @echo Welcome to libcurl
$(OBJ_DIR): $(OBJ_BASE):
mkdir $(OBJ_DIR) - mkdir $(OBJ_BASE)
- mkdir $(OBJ_BASE)\stat
- mkdir $(OBJ_BASE)\dyn
libcurl_wc.dll libcurl_wc_imp.lib: $(OBJS) $(RESOURCE) $(LINK_ARG) libcurl_wc.dll libcurl_wc_imp.lib: $(OBJS_DYN) $(RESOURCE) $(LINK_ARG)
wlink name libcurl_wc.dll @$(LINK_ARG) wlink name libcurl_wc.dll @$(LINK_ARG)
libcurl_wc.lib: $(OBJS_STAT) $(LIB_ARG)
wlib -q -b- c $@ @$(LIB_ARG)
clean: .SYMBOLIC clean: .SYMBOLIC
- rm -f $(OBJS) $(RESOURCE) - rm -f $(OBJS_STAT) $(OBJS_DYN) $(RESOURCE) $(C_ARG) $(LINK_ARG) $(LIB_ARG)
vclean realclean: clean .SYMBOLIC vclean realclean: clean .SYMBOLIC
- rm -f $(TARGETS) $(C_ARG) $(LINK_ARG) libcurl_wc.map - rm -f $(TARGETS) libcurl_wc.map
- rmdir $(OBJ_DIR) - rmdir $(OBJ_BASE)\stat
- rmdir $(OBJ_BASE)\dyn
- rmdir $(OBJ_BASE)
.ERASE .ERASE
$(RESOURCE): libcurl.rc $(RESOURCE): libcurl.rc
wrc -dCURLDEBUG=1 -q -r -zm -I..\include -fo=$@ libcurl.rc wrc -dCURLDEBUG=1 -q -r -zm -I..\include -fo=$@ libcurl.rc
.ERASE .ERASE
.c{$(OBJ_DIR)}.obj: .c{$(OBJ_BASE)\dyn}.obj:
$(CC) $[@ @$(C_ARG) -fo=$@ $(CC) $[@ @$(C_ARG) -fo=$@
.ERASE
.c{$(OBJ_BASE)\stat}.obj:
$(CC) $[@ @$(C_ARG) -DCURL_STATICLIB -fo=$@
$(C_ARG): $(__MAKEFILES__) $(C_ARG): $(__MAKEFILES__)
%create $^@ %create $^@
%append $^@ $(CFLAGS) %append $^@ $(CFLAGS)
@ -91,7 +112,7 @@ $(C_ARG): $(__MAKEFILES__)
$(LINK_ARG): $(__MAKEFILES__) $(LINK_ARG): $(__MAKEFILES__)
%create $^@ %create $^@
@%append $^@ system nt dll @%append $^@ system nt dll
@%append $^@ file { $(OBJS) } @%append $^@ file { $(OBJS_DYN) }
@%append $^@ option quiet, map, caseexact, eliminate, implib=libcurl_wc_imp.lib, @%append $^@ option quiet, map, caseexact, eliminate, implib=libcurl_wc_imp.lib,
@%append $^@ res=$(RESOURCE) libpath $(%watcom)\lib386;$(%watcom)\lib386\nt @%append $^@ res=$(RESOURCE) libpath $(%watcom)\lib386;$(%watcom)\lib386\nt
@%append $^@ library clib3r.lib, wldap32.lib, ws2_32.lib @%append $^@ library clib3r.lib, wldap32.lib, ws2_32.lib
@ -99,6 +120,10 @@ $(LINK_ARG): $(__MAKEFILES__)
@%append $^@ library $(ZLIB_ROOT)\zlib.lib @%append $^@ library $(ZLIB_ROOT)\zlib.lib
!endif !endif
$(LIB_ARG): $(__MAKEFILES__)
%create $^@
for %f in ($(OBJS_STAT)) do @%append $^@ +- %f
# #
# Dependencies based on "gcc -MM .." # Dependencies based on "gcc -MM .."
# #