1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 16:18:48 -05:00

modified to use new Makefile.inc to build up object list;

added generation of config.h and a prebuild target to create all neded files.
This commit is contained in:
Gunter Knauf 2004-07-03 18:06:39 +00:00
parent 592658e874
commit fc0df97278

View File

@ -11,11 +11,19 @@
ifndef NDKBASE ifndef NDKBASE
NDKBASE = c:/novell NDKBASE = c:/novell
endif endif
INSTDIR = ..\curl-$(LIBCURL_VERSION_STR)-bin-nw
# Edit the path below to point to the base of your Zlib sources. # Edit the path below to point to the base of your Zlib sources.
#ZLIB_PATH = ../../zlib-1.2.1 #ZLIB_PATH = ../../zlib-1.2.1
# Edit the path below to point to the base of your OpenSSL package.
ifndef OPENSSL_PATH
OPENSSL_PATH = ../../openssl-0.9.7d
endif
ifndef INSTDIR
INSTDIR = ../curl-$(LIBCURL_VERSION_STR)-bin-nw
endif
# Edit the vars below to change NLM target settings. # Edit the vars below to change NLM target settings.
TARGET = libcurl TARGET = libcurl
VERSION = $(LIBCURL_VERSION) VERSION = $(LIBCURL_VERSION)
@ -53,6 +61,7 @@ ifdef METROWERKS
else else
CC = gcc CC = gcc
endif endif
YACC = bison -y
CP = cp -afv CP = cp -afv
# RM = rm -f # RM = rm -f
# if you want to mark the target as MTSAFE you will need a tool for # if you want to mark the target as MTSAFE you will need a tool for
@ -61,11 +70,11 @@ CP = cp -afv
MPKXDC = mkxdc MPKXDC = mkxdc
# Global flags for all compilers # Global flags for all compilers
CFLAGS = $(OPT) -D$(DB) -DNETWARE -nostdinc CFLAGS = $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
ifeq ($(CC),mwccnlm) ifeq ($(CC),mwccnlm)
LD = mwldnlm LD = mwldnlm
LDFLAGS = -nostdlib $(PRELUDE) $(OBJDIR)/*.o -o $(OBJDIR)/$(TARGET).nlm -commandfile LDFLAGS = -nostdlib $(PRELUDE) $(OBJDIR)/*.o -o $(TARGET).nlm -commandfile
AR = mwldnlm AR = mwldnlm
ARFLAGS = -type library -w nocmdline $(OBJDIR)/*.o -o ARFLAGS = -type library -w nocmdline $(OBJDIR)/*.o -o
CFLAGS += -msgstyle gcc -gccinc -inline off -opt nointrinsics -proc 586 CFLAGS += -msgstyle gcc -gccinc -inline off -opt nointrinsics -proc 586
@ -74,8 +83,6 @@ CFLAGS += -relax_pointers
ifeq ($(LIBARCH),LIBC) ifeq ($(LIBARCH),LIBC)
PRELUDE = $(SDK_LIBC)/imports/libcpre.o PRELUDE = $(SDK_LIBC)/imports/libcpre.o
CFLAGS += -align 4 CFLAGS += -align 4
CFLAGS += -D_POSIX_SOURCE
# CFLAGS += -D__ANSIC__
else else
PRELUDE = "$(METROWERKS)/Novell Support/libraries/runtime/prelude.obj" PRELUDE = "$(METROWERKS)/Novell Support/libraries/runtime/prelude.obj"
# CFLAGS += -include "$(METROWERKS)/Novell Support/headers/nlm_prefix.h" # CFLAGS += -include "$(METROWERKS)/Novell Support/headers/nlm_prefix.h"
@ -90,8 +97,6 @@ CFLAGS += -fno-builtin -fpack-struct -fpcc-struct-return
CFLAGS += -Wall # -pedantic CFLAGS += -Wall # -pedantic
ifeq ($(LIBARCH),LIBC) ifeq ($(LIBARCH),LIBC)
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
CFLAGS += -D_POSIX_SOURCE
# CFLAGS += -D__ANSIC__
else else
PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o
CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
@ -107,17 +112,26 @@ SDK_LDAP = $(NDK_ROOT)/cldapsdk/netware
INCLUDES = -I. -I../include INCLUDES = -I. -I../include
ifdef WITH_ARES
INCLUDES += -I../ares
LFLAGS += -L../ares -lcares
endif
ifdef ZLIB_PATH ifdef ZLIB_PATH
INCLUDES += -I$(ZLIB_PATH) INCLUDES += -I$(ZLIB_PATH)
CFLAGS += -DHAVE_ZLIB_H -DHAVE_LIBZ
IMPORTS = @$(ZLIB_PATH)/nw/zlib.imp IMPORTS = @$(ZLIB_PATH)/nw/zlib.imp
MODULES = libz.nlm MODULES = libz.nlm
endif endif
ifdef SSL
INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_libc -I$(OPENSSL_PATH)/outinc_nw_libc/openssl
LFLAGS += -L$(OPENSSL_PATH)/out_nw_libc -crypto -lssl
endif
ifeq ($(LIBARCH),LIBC) ifeq ($(LIBARCH),LIBC)
INCLUDES += -I$(SDK_LIBC)/include -I$(SDK_LIBC)/include/nks INCLUDES += -I$(SDK_LIBC)/include -I$(SDK_LIBC)/include/nks
INCLUDES += -I$(SDK_LIBC)/include/winsock INCLUDES += -I$(SDK_LIBC)/include/winsock
# INCLUDES += -I$(SDK_LDAP)/libc/inc # INCLUDES += -I$(SDK_LDAP)/libc/inc
CFLAGS += -D_POSIX_SOURCE
# CFLAGS += -D__ANSIC__
else else
INCLUDES += -I$(SDK_CLIB)/include/nlm -I$(SDK_CLIB)/include INCLUDES += -I$(SDK_CLIB)/include/nlm -I$(SDK_CLIB)/include
# INCLUDES += -I$(SDK_CLIB)/include/nlm/obsolete # INCLUDES += -I$(SDK_CLIB)/include/nlm/obsolete
@ -141,67 +155,20 @@ DL = '
#-include $(NDKBASE)/nlmconv/ncpfs.inc #-include $(NDKBASE)/nlmconv/ncpfs.inc
endif endif
OBJS = \ include Makefile.inc
$(OBJDIR)/file.o \
$(OBJDIR)/timeval.o \ OBJS := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(CSOURCES)))
$(OBJDIR)/base64.o \
$(OBJDIR)/hostip.o \
$(OBJDIR)/progress.o \
$(OBJDIR)/formdata.o \
$(OBJDIR)/cookie.o \
$(OBJDIR)/http.o \
$(OBJDIR)/sendf.o \
$(OBJDIR)/ftp.o \
$(OBJDIR)/url.o \
$(OBJDIR)/dict.o \
$(OBJDIR)/if2ip.o \
$(OBJDIR)/speedcheck.o \
$(OBJDIR)/getdate.o \
$(OBJDIR)/transfer.o \
$(OBJDIR)/ldap.o \
$(OBJDIR)/ssluse.o \
$(OBJDIR)/version.o \
$(OBJDIR)/getenv.o \
$(OBJDIR)/escape.o \
$(OBJDIR)/mprintf.o \
$(OBJDIR)/telnet.o \
$(OBJDIR)/netrc.o \
$(OBJDIR)/getinfo.o \
$(OBJDIR)/strequal.o \
$(OBJDIR)/easy.o \
$(OBJDIR)/security.o \
$(OBJDIR)/krb4.o \
$(OBJDIR)/memdebug.o \
$(OBJDIR)/http_chunks.o \
$(OBJDIR)/strtok.o \
$(OBJDIR)/connect.o \
$(OBJDIR)/hash.o \
$(OBJDIR)/llist.o \
$(OBJDIR)/multi.o \
$(OBJDIR)/share.o \
$(OBJDIR)/content_encoding.o \
$(OBJDIR)/http_digest.o \
$(OBJDIR)/http_negotiate.o \
$(OBJDIR)/http_ntlm.o \
$(OBJDIR)/md5.o \
$(OBJDIR)/strtoofft.o \
$(OBJDIR)/strerror.o \
$(OBJDIR)/hostares.o \
$(OBJDIR)/hostasyn.o \
$(OBJDIR)/hostip4.o \
$(OBJDIR)/hostip6.o \
$(OBJDIR)/hostsyn.o \
$(OBJDIR)/hostthre.o \
$(OBJDIR)/inet_ntop.o \
OBJL = $(OBJS) $(OBJDIR)/nwlib.o OBJL = $(OBJS) $(OBJDIR)/nwlib.o
nlm: $(OBJDIR) $(OBJDIR)/version.inc $(OBJDIR)/$(TARGET).nlm
lib: $(OBJDIR) $(OBJDIR)/$(TARGET).lib
all: lib nlm all: lib nlm
nlm: prebuild $(TARGET).nlm
lib: prebuild $(TARGET).lib
prebuild: $(OBJDIR) $(OBJDIR)/version.inc config.h ca-bundle.h getdate.c
$(OBJDIR)/%.o: %.c $(OBJDIR)/%.o: %.c
# @echo Compiling $< # @echo Compiling $<
$(CC) $(CFLAGS) -c $< -o $@ $(CC) $(CFLAGS) -c $< -o $@
@ -216,12 +183,14 @@ dist: all
install: $(INSTDIR) all install: $(INSTDIR) all
@$(CP) $(TARGET).nlm $(INSTDIR) @$(CP) $(TARGET).nlm $(INSTDIR)
@$(CP) $(TARGET).lib $(INSTDIR)
@$(CP) ../CHANGES $(INSTDIR) @$(CP) ../CHANGES $(INSTDIR)
@$(CP) ../COPYING $(INSTDIR) @$(CP) ../COPYING $(INSTDIR)
@$(CP) ../README $(INSTDIR) @$(CP) ../README $(INSTDIR)
@$(CP) ../RELEASE-NOTES $(INSTDIR) @$(CP) ../RELEASE-NOTES $(INSTDIR)
clean: clean:
-$(RM) config.h ca-bundle.h y.tab.c getdate.c
-$(RM) -r $(OBJDIR) -$(RM) -r $(OBJDIR)
$(INSTDIR): $(INSTDIR):
@ -230,12 +199,12 @@ $(INSTDIR):
$(OBJDIR): $(OBJDIR):
@mkdir $(OBJDIR) @mkdir $(OBJDIR)
$(OBJDIR)/$(TARGET).lib: $(OBJS) $(TARGET).lib: $(OBJS)
@echo Creating $@ @echo Creating $@
@-$(RM) $@ @-$(RM) $@
@$(AR) $(ARFLAGS) $@ $^ @$(AR) $(ARFLAGS) $@ $^
$(OBJDIR)/$(TARGET).nlm: $(OBJL) $(OBJDIR)/$(TARGET).def $(XDCDATA) $(TARGET).nlm: $(OBJL) $(OBJDIR)/$(TARGET).def $(XDCDATA)
@echo Linking $@ @echo Linking $@
@-$(RM) $@ @-$(RM) $@
@$(LD) $(LDFLAGS) $(OBJDIR)/$(TARGET).def @$(LD) $(LDFLAGS) $(OBJDIR)/$(TARGET).def
@ -304,11 +273,94 @@ ifdef IMPORTS
@echo $(DL)import $(IMPORTS)$(DL) >> $@ @echo $(DL)import $(IMPORTS)$(DL) >> $@
endif endif
ifeq ($(LD),nlmconv) ifeq ($(LD),nlmconv)
@echo $(DL)input $(OBJS)$(DL) >> $@ @echo $(DL)input $(OBJL)$(DL) >> $@
@echo $(DL)input $(PRELUDE)$(DL) >> $@ @echo $(DL)input $(PRELUDE)$(DL) >> $@
@echo $(DL)output $(TARGET).nlm$(DL) >> $@ @echo $(DL)output $(TARGET).nlm$(DL) >> $@
endif endif
config.h: Makefile.netware
@echo Creating $@
@echo $(DL)/* $@ for NetWare target.$(DL) > $@
@echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@
@echo $(DL)** All your changes will be lost!!$(DL) >> $@
@echo $(DL)*/$(DL) >> $@
@echo $(DL)#define OS "i586-pc-NetWare"$(DL) >> $@
@echo $(DL)#define VERSION "$(LIBCURL_VERSION_STR)"$(DL) >> $@
@echo $(DL)#define PACKAGE_BUGREPORT "curl-bug@haxx.se"$(DL) >> $@
@echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@
@echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
@echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@
@echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@
@echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@
@echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@
@echo $(DL)#define HAVE_FIONBIO 1$(DL) >> $@
@echo $(DL)#define HAVE_GETHOSTBYADDR 1$(DL) >> $@
@echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
@echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@
@echo $(DL)#define HAVE_INET_NTOA 1$(DL) >> $@
@echo $(DL)#define HAVE_INET_PTON 1$(DL) >> $@
@echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
@echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
@echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
@echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
@echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
@echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@
@echo $(DL)#define HAVE_SIGNAL 1$(DL) >> $@
@echo $(DL)#define HAVE_SOCKET 1$(DL) >> $@
@echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@
@echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@
@echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@
@echo $(DL)#define HAVE_STRDUP 1$(DL) >> $@
@echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@
@echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@
@echo $(DL)#define HAVE_STRLCAT 1$(DL) >> $@
@echo $(DL)#define HAVE_STRLCPY 1$(DL) >> $@
@echo $(DL)#define HAVE_STRSTR 1$(DL) >> $@
@echo $(DL)#define HAVE_SYS_PARAM_H 1$(DL) >> $@
@echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@
@echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@
@echo $(DL)#define HAVE_SYS_TIME_H 1$(DL) >> $@
@echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@
@echo $(DL)#define HAVE_TIME_H 1$(DL) >> $@
@echo $(DL)#define HAVE_UNAME 1$(DL) >> $@
@echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
@echo $(DL)#define RETSIGTYPE void$(DL) >> $@
@echo $(DL)#define SIZEOF_CURL_OFF_T 4$(DL) >> $@
@echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
@echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@
ifdef NW_WINSOCK
@echo $(DL)#define HAVE_CLOSESOCKET 1$(DL) >> $@
else
@echo $(DL)#define HAVE_SYS_TYPES_H 1$(DL) >> $@
@echo $(DL)#define HAVE_SYS_SOCKET_H 1$(DL) >> $@
@echo $(DL)#define HAVE_SYS_SOCKIO_H 1$(DL) >> $@
@echo $(DL)#define HAVE_NETDB_H 1$(DL) >> $@
endif
ifdef WITH_ARES
@echo $(DL)#define USE_ARES 1$(DL) >> $@
endif
ifdef ZLIB_PATH
@echo $(DL)#define HAVE_ZLIB_H 1$(DL) >> $@
@echo $(DL)#define HAVE_LIBZ 1$(DL) >> $@
endif
ifdef SSL
@echo $(DL)#define USE_SSLEAY 1$(DL) >> $@
@echo $(DL)#define HAVE_OPENSSL_X509_H 1$(DL) >> $@
@echo $(DL)#define HAVE_OPENSSL_SSL_H 1$(DL) >> $@
@echo $(DL)#define HAVE_OPENSSL_RSA_H 1$(DL) >> $@
@echo $(DL)#define HAVE_OPENSSL_PEM_H 1$(DL) >> $@
@echo $(DL)#define HAVE_OPENSSL_ERR_H 1$(DL) >> $@
@echo $(DL)#define HAVE_OPENSSL_CRYPTO_H 1$(DL) >> $@
@echo $(DL)#define HAVE_OPENSSL_ENGINE_H 1$(DL) >> $@
@echo $(DL)#define HAVE_LIBSSL 1$(DL) >> $@
@echo $(DL)#define HAVE_LIBCRYPTO 1$(DL) >> $@
@echo $(DL)#define OPENSSL_NO_KRB5 1$(DL) >> $@
endif
ifdef OLD_NOVELLSDK
@echo $(DL)#define socklen_t int$(DL) >> $@
endif
ca-bundle.h: Makefile.netware ca-bundle.h: Makefile.netware
@echo Creating $@ @echo Creating $@
@echo $(DL)/* Do not edit this file - it is created by make!$(DL) > $@ @echo $(DL)/* Do not edit this file - it is created by make!$(DL) > $@
@ -316,10 +368,10 @@ ca-bundle.h: Makefile.netware
@echo $(DL)*/$(DL) >> $@ @echo $(DL)*/$(DL) >> $@
@echo $(DL)#define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE")$(DL) >> $@ @echo $(DL)#define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE")$(DL) >> $@
getdate.c: getdate.c.cvs getdate.c:
@echo Creating $@ @echo Creating $@
@-$(RM) getdate.y @-$(RM) getdate.y
@$(CP) $< $@ @$(CP) getdate.c.cvs $@
url.c: ca-bundle.h url.c: ca-bundle.h