curl/docs/examples/Makefile.mk

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.5 KiB
Makefile
Raw Normal View History

2011-03-12 07:14:32 +08:00
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
2011-03-12 07:14:32 +08:00
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
2020-11-04 21:02:01 +08:00
# are also available at https://curl.se/docs/copyright.html.
2011-03-12 07:14:32 +08:00
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
#***************************************************************************
Makefile.mk: portable Makefile.m32 Update bare GNU Make `Makefile.m32` to: - Move objects into a subdirectory. - Add support for MS-DOS. Tested with DJGPP. - Add support for Watt-32 (on MS-DOS). - Add support for AmigaOS. - Rename `Makefile.m32` to `Makefile.mk` - Replace `ARCH` with `TRIPLET`. - Build `tool_hugehelp.c` proper (when tools are available). - Drop MS-DOS compatibility macro `USE_ZLIB` (replaced by `HAVE_LIBZ`) - Add support for `ZLIB_LIBS` to override `-lz`. - Omit object files when building examples. - Default `CC` to `gcc` once again, for convenience. (Caveat: compiler name `cc` cannot be set now.) - Set `-DCURL_NO_OLDIES` for examples, like autotools does. - Delete `makefile.dj` files. Notice the configuration details and defaults are not retained with the new method. - Delete `makefile.amiga` files. A successful build needs a few custom options. We're also not retaining all build details from the existing Amiga make files. - Rename `Makefile.m32` to `Makefile.mk` to reflect that they are not Windows/MinGW32-specific anymore. - Add support for new `CFG` options: `-map`, `-debug`, `-trackmem` - Set `-DNDEBUG` by default. - Allow using `-DOS=...` in all `lib/config-*.h` headers, syncing this with `config-win32.h`. - Look for zlib parts in `ZLIB_PATH/include` and `ZLIB_PATH/lib` instead of bare `ZLIB_PATH`. Note that existing build configurations for MS-DOS and AmigaOS likely become incompatible with this change. Example AmigaOS configuration: ``` export CROSSPREFIX=/opt/amiga/bin/m68k-amigaos- export CC=gcc export CPPFLAGS='-DHAVE_PROTO_BSDSOCKET_H' export CFLAGS='-mcrt=clib2' export LDFLAGS="${CFLAGS}" export LIBS='-lnet -lm' make -C lib -f Makefile.mk make -C src -f Makefile.mk ``` Example MS-DOS configuration: ``` export CROSSPREFIX=/opt/djgpp/bin/i586-pc-msdosdjgpp- export WATT_PATH=/opt/djgpp/net/watt export ZLIB_PATH=/opt/djgpp export OPENSSL_PATH=/opt/djgpp export OPENSSL_LIBS='-lssl -lcrypt' export CFG=-zlib-ssl make -C lib -f Makefile.mk make -C src -f Makefile.mk ``` Closes #9764
2022-11-22 16:25:05 +08:00
# Build libcurl via lib/Makefile.mk first.
Makefile.m32: major rework [ci skip] This patch overhauls `Makefile.m32` scripts, fixing a list of quirks, making its behaviour and customization envvars align better with other build systems, aiming for less code, that is easier to read, use and maintain. Details: - Rename customization envvars: `CURL_CC` -> `CC` `CURL_RC` -> `RC` `CURL_AR` -> `AR` `CURL_LDFLAG_EXTRAS_DLL` -> `CURL_LDFLAGS_LIB` `CURL_LDFLAG_EXTRAS_EXE` -> `CURL_LDFLAGS_BIN` - Drop `CURL_STRIP` and `CURL_RANLIB`. These tools are no longer used. - Accept `CFLAGS`, `CPPFLAGS`, `RCFLAGS`, `LDFLAGS` and `LIBS` envvars. - Drop `CURL_CFLAG_EXTRAS`, `CURL_LDFLAG_EXTRAS`, `CURL_RCFLAG_EXTRAS` in favor of the above. - Do not automatically enable `zlib` with `libssh2`. `zlib` is optional with `libssh2`. - Omit unnecessary `CPPFLAGS` options when building `curl.exe` and examples. - Drop support for deprecated `-winssl` `CFG` option. Use `-schannel` instead. - Avoid late evaluation where not necessary (`=` -> `:=`). - Drop support for `CURL_DLL_A_SUFFIX` to override the implib suffix. Instead, use the standard naming scheme by default: `libcurl.dll.a`. The toolchain recognizes the name, and selects it automatically when asking for a `-shared` vs. `-static` build. - Stop applying `strip` to `libcurl.a`. Follow-up from 16a58e9f93c7e89e1f87720199388bcfcfa148a4. There was no debug info to strip since then. - Stop setting `-O3`, `-W`, `-Wall` options. You can add these to `CFLAGS` as desired. - Always enable `-DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG` with OpenSSL, to avoid that vulnerability on Windows. - Add `-lbrotlicommon` to `LIBS` when using `brotli`. - Do not enable `-nghttp3` without `-ngtcp2`. - `-ssh2` and `-rtmp` options no longer try to auto-select a TLS-backend. You need to set the backend explicitly. This scales better and avoids issues with certain combinations (e.g. `libssh2` + `wolfssl` with no `schannel`). - Default to OpenSSL TLS-backend with `ngtcp2`. Possible to override via `NGTCP2_LIBS`. - Old, alternate method of enabling components (e.g. `SSH2=1`) no longer supported. - Delete `SPNEGO` references. They were no-ops. - Drop support for Win9x environments. - Allow setting `OPENSSL_LIBS` independently from `OPENSSL_LIBPATH`. - Support autotools/CMake `libssh2` builds by default. - Respect `CURL_DLL_SUFFIX` in `-dyn` mode when building `curl.exe` and examples. - Assume standard directory layout with `LIBCARES_PATH`. (Instead of the long gone embedded one.) - Stop static linking with c-ares by default. Add `CPPFLAGS=-DCARES_STATICLIB` to enable it. - Reorganize internal layout to avoid redundancy and emit clean diffs between src/lib and example make files. - Delete unused variables. - Code cleanups/rework. - Comment and indentation fixes. Closes #9632
2022-10-04 03:46:56 +08:00
PROOT := ../..
Makefile.m32: cleanups and fixes [ci skip] - Add `-lcrypt32` once, and add it always for simplicity. - Delete broken link and reference to the pre-Vista WinIDN add-on. MS no longer distribute it. - Delete related `WINIDN_PATH` option. IDN is a system lib since Vista. - Sync `LIBCARES_PATH` default with the rest of dependencies. - Delete version numbers from dependency path defaults. - `libgsasl` package is now called `gsasl`. - Delete `libexpat` and `libxml2` references. No longer used by curl. - Delete `Edit the path below...` comments. We recommend to predefine those envvars instead. - `libcares.a` is not an internal dependency anymore. Stop using it as such. - `windres` `--include-dir` -> `-I`, `-F` -> `--target=` for readability. - Delete `STRIP`, `CURL_STRIP`, `AR` references from `src/Makefile.m32`. They were never used. - Stop to `clean` some objects twice in `src/Makefile.m32`. - Delete cvs-specific leftovers. - Finish resource support in examples make file. - Delete `-I<root>/lib` from examples make file. - Fix copyright start year in examples make file. - Delete duplicate `ftpuploadresume` input in examples make file. - Sync OpenSSL lib order, `SYNC` support, `PROOT` use, dependency path defaults, variables names and other internal bits between the three make files. - `lib/Makefile.m32` accepted custom options via `DLL_LIBS` envvar. This was lib-specific and possibly accidental. Use `CURL_LDFLAG_EXTRAS_DLL` envvar for the same effect. - Fix linking `curl.exe` and examples to wrong static libs with auto-detected OpenSSL 1.0.2 or earlier. - Add `-lgdi32` for OpenSSL 1.0.2 and earlier only. - Add link to Novell LDAP SDK and use a relative default path. Latest version is from 2016, linked to an outdated OpenSSL 1.0.1. - Whitespace and comment cleanups. TODO in a next commit: Delete built-in detection/logic for OpenSSL 1.0.2 and earlier, the Novell LDAP SDK and the other LDAP SDK (which is _not_ OpenLDAP). Write up the necessary custom envvars to configure them. Closes #9616
2022-10-01 18:07:34 +08:00
Makefile.mk: portable Makefile.m32 Update bare GNU Make `Makefile.m32` to: - Move objects into a subdirectory. - Add support for MS-DOS. Tested with DJGPP. - Add support for Watt-32 (on MS-DOS). - Add support for AmigaOS. - Rename `Makefile.m32` to `Makefile.mk` - Replace `ARCH` with `TRIPLET`. - Build `tool_hugehelp.c` proper (when tools are available). - Drop MS-DOS compatibility macro `USE_ZLIB` (replaced by `HAVE_LIBZ`) - Add support for `ZLIB_LIBS` to override `-lz`. - Omit object files when building examples. - Default `CC` to `gcc` once again, for convenience. (Caveat: compiler name `cc` cannot be set now.) - Set `-DCURL_NO_OLDIES` for examples, like autotools does. - Delete `makefile.dj` files. Notice the configuration details and defaults are not retained with the new method. - Delete `makefile.amiga` files. A successful build needs a few custom options. We're also not retaining all build details from the existing Amiga make files. - Rename `Makefile.m32` to `Makefile.mk` to reflect that they are not Windows/MinGW32-specific anymore. - Add support for new `CFG` options: `-map`, `-debug`, `-trackmem` - Set `-DNDEBUG` by default. - Allow using `-DOS=...` in all `lib/config-*.h` headers, syncing this with `config-win32.h`. - Look for zlib parts in `ZLIB_PATH/include` and `ZLIB_PATH/lib` instead of bare `ZLIB_PATH`. Note that existing build configurations for MS-DOS and AmigaOS likely become incompatible with this change. Example AmigaOS configuration: ``` export CROSSPREFIX=/opt/amiga/bin/m68k-amigaos- export CC=gcc export CPPFLAGS='-DHAVE_PROTO_BSDSOCKET_H' export CFLAGS='-mcrt=clib2' export LDFLAGS="${CFLAGS}" export LIBS='-lnet -lm' make -C lib -f Makefile.mk make -C src -f Makefile.mk ``` Example MS-DOS configuration: ``` export CROSSPREFIX=/opt/djgpp/bin/i586-pc-msdosdjgpp- export WATT_PATH=/opt/djgpp/net/watt export ZLIB_PATH=/opt/djgpp export OPENSSL_PATH=/opt/djgpp export OPENSSL_LIBS='-lssl -lcrypt' export CFG=-zlib-ssl make -C lib -f Makefile.mk make -C src -f Makefile.mk ``` Closes #9764
2022-11-22 16:25:05 +08:00
### Common
include $(PROOT)/lib/Makefile.mk
### Local
CPPFLAGS += -DCURL_NO_OLDIES
Makefile.m32: major rework [ci skip] This patch overhauls `Makefile.m32` scripts, fixing a list of quirks, making its behaviour and customization envvars align better with other build systems, aiming for less code, that is easier to read, use and maintain. Details: - Rename customization envvars: `CURL_CC` -> `CC` `CURL_RC` -> `RC` `CURL_AR` -> `AR` `CURL_LDFLAG_EXTRAS_DLL` -> `CURL_LDFLAGS_LIB` `CURL_LDFLAG_EXTRAS_EXE` -> `CURL_LDFLAGS_BIN` - Drop `CURL_STRIP` and `CURL_RANLIB`. These tools are no longer used. - Accept `CFLAGS`, `CPPFLAGS`, `RCFLAGS`, `LDFLAGS` and `LIBS` envvars. - Drop `CURL_CFLAG_EXTRAS`, `CURL_LDFLAG_EXTRAS`, `CURL_RCFLAG_EXTRAS` in favor of the above. - Do not automatically enable `zlib` with `libssh2`. `zlib` is optional with `libssh2`. - Omit unnecessary `CPPFLAGS` options when building `curl.exe` and examples. - Drop support for deprecated `-winssl` `CFG` option. Use `-schannel` instead. - Avoid late evaluation where not necessary (`=` -> `:=`). - Drop support for `CURL_DLL_A_SUFFIX` to override the implib suffix. Instead, use the standard naming scheme by default: `libcurl.dll.a`. The toolchain recognizes the name, and selects it automatically when asking for a `-shared` vs. `-static` build. - Stop applying `strip` to `libcurl.a`. Follow-up from 16a58e9f93c7e89e1f87720199388bcfcfa148a4. There was no debug info to strip since then. - Stop setting `-O3`, `-W`, `-Wall` options. You can add these to `CFLAGS` as desired. - Always enable `-DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG` with OpenSSL, to avoid that vulnerability on Windows. - Add `-lbrotlicommon` to `LIBS` when using `brotli`. - Do not enable `-nghttp3` without `-ngtcp2`. - `-ssh2` and `-rtmp` options no longer try to auto-select a TLS-backend. You need to set the backend explicitly. This scales better and avoids issues with certain combinations (e.g. `libssh2` + `wolfssl` with no `schannel`). - Default to OpenSSL TLS-backend with `ngtcp2`. Possible to override via `NGTCP2_LIBS`. - Old, alternate method of enabling components (e.g. `SSH2=1`) no longer supported. - Delete `SPNEGO` references. They were no-ops. - Drop support for Win9x environments. - Allow setting `OPENSSL_LIBS` independently from `OPENSSL_LIBPATH`. - Support autotools/CMake `libssh2` builds by default. - Respect `CURL_DLL_SUFFIX` in `-dyn` mode when building `curl.exe` and examples. - Assume standard directory layout with `LIBCARES_PATH`. (Instead of the long gone embedded one.) - Stop static linking with c-ares by default. Add `CPPFLAGS=-DCARES_STATICLIB` to enable it. - Reorganize internal layout to avoid redundancy and emit clean diffs between src/lib and example make files. - Delete unused variables. - Code cleanups/rework. - Comment and indentation fixes. Closes #9632
2022-10-04 03:46:56 +08:00
LDFLAGS += -L$(PROOT)/lib
Makefile.mk: portable Makefile.m32 Update bare GNU Make `Makefile.m32` to: - Move objects into a subdirectory. - Add support for MS-DOS. Tested with DJGPP. - Add support for Watt-32 (on MS-DOS). - Add support for AmigaOS. - Rename `Makefile.m32` to `Makefile.mk` - Replace `ARCH` with `TRIPLET`. - Build `tool_hugehelp.c` proper (when tools are available). - Drop MS-DOS compatibility macro `USE_ZLIB` (replaced by `HAVE_LIBZ`) - Add support for `ZLIB_LIBS` to override `-lz`. - Omit object files when building examples. - Default `CC` to `gcc` once again, for convenience. (Caveat: compiler name `cc` cannot be set now.) - Set `-DCURL_NO_OLDIES` for examples, like autotools does. - Delete `makefile.dj` files. Notice the configuration details and defaults are not retained with the new method. - Delete `makefile.amiga` files. A successful build needs a few custom options. We're also not retaining all build details from the existing Amiga make files. - Rename `Makefile.m32` to `Makefile.mk` to reflect that they are not Windows/MinGW32-specific anymore. - Add support for new `CFG` options: `-map`, `-debug`, `-trackmem` - Set `-DNDEBUG` by default. - Allow using `-DOS=...` in all `lib/config-*.h` headers, syncing this with `config-win32.h`. - Look for zlib parts in `ZLIB_PATH/include` and `ZLIB_PATH/lib` instead of bare `ZLIB_PATH`. Note that existing build configurations for MS-DOS and AmigaOS likely become incompatible with this change. Example AmigaOS configuration: ``` export CROSSPREFIX=/opt/amiga/bin/m68k-amigaos- export CC=gcc export CPPFLAGS='-DHAVE_PROTO_BSDSOCKET_H' export CFLAGS='-mcrt=clib2' export LDFLAGS="${CFLAGS}" export LIBS='-lnet -lm' make -C lib -f Makefile.mk make -C src -f Makefile.mk ``` Example MS-DOS configuration: ``` export CROSSPREFIX=/opt/djgpp/bin/i586-pc-msdosdjgpp- export WATT_PATH=/opt/djgpp/net/watt export ZLIB_PATH=/opt/djgpp export OPENSSL_PATH=/opt/djgpp export OPENSSL_LIBS='-lssl -lcrypt' export CFG=-zlib-ssl make -C lib -f Makefile.mk make -C src -f Makefile.mk ``` Closes #9764
2022-11-22 16:25:05 +08:00
LIBS := -lcurl $(LIBS)
Makefile.m32: major rework [ci skip] This patch overhauls `Makefile.m32` scripts, fixing a list of quirks, making its behaviour and customization envvars align better with other build systems, aiming for less code, that is easier to read, use and maintain. Details: - Rename customization envvars: `CURL_CC` -> `CC` `CURL_RC` -> `RC` `CURL_AR` -> `AR` `CURL_LDFLAG_EXTRAS_DLL` -> `CURL_LDFLAGS_LIB` `CURL_LDFLAG_EXTRAS_EXE` -> `CURL_LDFLAGS_BIN` - Drop `CURL_STRIP` and `CURL_RANLIB`. These tools are no longer used. - Accept `CFLAGS`, `CPPFLAGS`, `RCFLAGS`, `LDFLAGS` and `LIBS` envvars. - Drop `CURL_CFLAG_EXTRAS`, `CURL_LDFLAG_EXTRAS`, `CURL_RCFLAG_EXTRAS` in favor of the above. - Do not automatically enable `zlib` with `libssh2`. `zlib` is optional with `libssh2`. - Omit unnecessary `CPPFLAGS` options when building `curl.exe` and examples. - Drop support for deprecated `-winssl` `CFG` option. Use `-schannel` instead. - Avoid late evaluation where not necessary (`=` -> `:=`). - Drop support for `CURL_DLL_A_SUFFIX` to override the implib suffix. Instead, use the standard naming scheme by default: `libcurl.dll.a`. The toolchain recognizes the name, and selects it automatically when asking for a `-shared` vs. `-static` build. - Stop applying `strip` to `libcurl.a`. Follow-up from 16a58e9f93c7e89e1f87720199388bcfcfa148a4. There was no debug info to strip since then. - Stop setting `-O3`, `-W`, `-Wall` options. You can add these to `CFLAGS` as desired. - Always enable `-DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG` with OpenSSL, to avoid that vulnerability on Windows. - Add `-lbrotlicommon` to `LIBS` when using `brotli`. - Do not enable `-nghttp3` without `-ngtcp2`. - `-ssh2` and `-rtmp` options no longer try to auto-select a TLS-backend. You need to set the backend explicitly. This scales better and avoids issues with certain combinations (e.g. `libssh2` + `wolfssl` with no `schannel`). - Default to OpenSSL TLS-backend with `ngtcp2`. Possible to override via `NGTCP2_LIBS`. - Old, alternate method of enabling components (e.g. `SSH2=1`) no longer supported. - Delete `SPNEGO` references. They were no-ops. - Drop support for Win9x environments. - Allow setting `OPENSSL_LIBS` independently from `OPENSSL_LIBPATH`. - Support autotools/CMake `libssh2` builds by default. - Respect `CURL_DLL_SUFFIX` in `-dyn` mode when building `curl.exe` and examples. - Assume standard directory layout with `LIBCARES_PATH`. (Instead of the long gone embedded one.) - Stop static linking with c-ares by default. Add `CPPFLAGS=-DCARES_STATICLIB` to enable it. - Reorganize internal layout to avoid redundancy and emit clean diffs between src/lib and example make files. - Delete unused variables. - Code cleanups/rework. - Comment and indentation fixes. Closes #9632
2022-10-04 03:46:56 +08:00
### Sources and targets
Makefile.m32: major rework [ci skip] This patch overhauls `Makefile.m32` scripts, fixing a list of quirks, making its behaviour and customization envvars align better with other build systems, aiming for less code, that is easier to read, use and maintain. Details: - Rename customization envvars: `CURL_CC` -> `CC` `CURL_RC` -> `RC` `CURL_AR` -> `AR` `CURL_LDFLAG_EXTRAS_DLL` -> `CURL_LDFLAGS_LIB` `CURL_LDFLAG_EXTRAS_EXE` -> `CURL_LDFLAGS_BIN` - Drop `CURL_STRIP` and `CURL_RANLIB`. These tools are no longer used. - Accept `CFLAGS`, `CPPFLAGS`, `RCFLAGS`, `LDFLAGS` and `LIBS` envvars. - Drop `CURL_CFLAG_EXTRAS`, `CURL_LDFLAG_EXTRAS`, `CURL_RCFLAG_EXTRAS` in favor of the above. - Do not automatically enable `zlib` with `libssh2`. `zlib` is optional with `libssh2`. - Omit unnecessary `CPPFLAGS` options when building `curl.exe` and examples. - Drop support for deprecated `-winssl` `CFG` option. Use `-schannel` instead. - Avoid late evaluation where not necessary (`=` -> `:=`). - Drop support for `CURL_DLL_A_SUFFIX` to override the implib suffix. Instead, use the standard naming scheme by default: `libcurl.dll.a`. The toolchain recognizes the name, and selects it automatically when asking for a `-shared` vs. `-static` build. - Stop applying `strip` to `libcurl.a`. Follow-up from 16a58e9f93c7e89e1f87720199388bcfcfa148a4. There was no debug info to strip since then. - Stop setting `-O3`, `-W`, `-Wall` options. You can add these to `CFLAGS` as desired. - Always enable `-DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG` with OpenSSL, to avoid that vulnerability on Windows. - Add `-lbrotlicommon` to `LIBS` when using `brotli`. - Do not enable `-nghttp3` without `-ngtcp2`. - `-ssh2` and `-rtmp` options no longer try to auto-select a TLS-backend. You need to set the backend explicitly. This scales better and avoids issues with certain combinations (e.g. `libssh2` + `wolfssl` with no `schannel`). - Default to OpenSSL TLS-backend with `ngtcp2`. Possible to override via `NGTCP2_LIBS`. - Old, alternate method of enabling components (e.g. `SSH2=1`) no longer supported. - Delete `SPNEGO` references. They were no-ops. - Drop support for Win9x environments. - Allow setting `OPENSSL_LIBS` independently from `OPENSSL_LIBPATH`. - Support autotools/CMake `libssh2` builds by default. - Respect `CURL_DLL_SUFFIX` in `-dyn` mode when building `curl.exe` and examples. - Assume standard directory layout with `LIBCARES_PATH`. (Instead of the long gone embedded one.) - Stop static linking with c-ares by default. Add `CPPFLAGS=-DCARES_STATICLIB` to enable it. - Reorganize internal layout to avoid redundancy and emit clean diffs between src/lib and example make files. - Delete unused variables. - Code cleanups/rework. - Comment and indentation fixes. Closes #9632
2022-10-04 03:46:56 +08:00
# Provides check_PROGRAMS
include Makefile.inc
Makefile.mk: portable Makefile.m32 Update bare GNU Make `Makefile.m32` to: - Move objects into a subdirectory. - Add support for MS-DOS. Tested with DJGPP. - Add support for Watt-32 (on MS-DOS). - Add support for AmigaOS. - Rename `Makefile.m32` to `Makefile.mk` - Replace `ARCH` with `TRIPLET`. - Build `tool_hugehelp.c` proper (when tools are available). - Drop MS-DOS compatibility macro `USE_ZLIB` (replaced by `HAVE_LIBZ`) - Add support for `ZLIB_LIBS` to override `-lz`. - Omit object files when building examples. - Default `CC` to `gcc` once again, for convenience. (Caveat: compiler name `cc` cannot be set now.) - Set `-DCURL_NO_OLDIES` for examples, like autotools does. - Delete `makefile.dj` files. Notice the configuration details and defaults are not retained with the new method. - Delete `makefile.amiga` files. A successful build needs a few custom options. We're also not retaining all build details from the existing Amiga make files. - Rename `Makefile.m32` to `Makefile.mk` to reflect that they are not Windows/MinGW32-specific anymore. - Add support for new `CFG` options: `-map`, `-debug`, `-trackmem` - Set `-DNDEBUG` by default. - Allow using `-DOS=...` in all `lib/config-*.h` headers, syncing this with `config-win32.h`. - Look for zlib parts in `ZLIB_PATH/include` and `ZLIB_PATH/lib` instead of bare `ZLIB_PATH`. Note that existing build configurations for MS-DOS and AmigaOS likely become incompatible with this change. Example AmigaOS configuration: ``` export CROSSPREFIX=/opt/amiga/bin/m68k-amigaos- export CC=gcc export CPPFLAGS='-DHAVE_PROTO_BSDSOCKET_H' export CFLAGS='-mcrt=clib2' export LDFLAGS="${CFLAGS}" export LIBS='-lnet -lm' make -C lib -f Makefile.mk make -C src -f Makefile.mk ``` Example MS-DOS configuration: ``` export CROSSPREFIX=/opt/djgpp/bin/i586-pc-msdosdjgpp- export WATT_PATH=/opt/djgpp/net/watt export ZLIB_PATH=/opt/djgpp export OPENSSL_PATH=/opt/djgpp export OPENSSL_LIBS='-lssl -lcrypt' export CFG=-zlib-ssl make -C lib -f Makefile.mk make -C src -f Makefile.mk ``` Closes #9764
2022-11-22 16:25:05 +08:00
TARGETS := $(patsubst %,%$(BIN_EXT),$(strip $(check_PROGRAMS)))
TOCLEAN := $(TARGETS)
Makefile.mk: portable Makefile.m32 Update bare GNU Make `Makefile.m32` to: - Move objects into a subdirectory. - Add support for MS-DOS. Tested with DJGPP. - Add support for Watt-32 (on MS-DOS). - Add support for AmigaOS. - Rename `Makefile.m32` to `Makefile.mk` - Replace `ARCH` with `TRIPLET`. - Build `tool_hugehelp.c` proper (when tools are available). - Drop MS-DOS compatibility macro `USE_ZLIB` (replaced by `HAVE_LIBZ`) - Add support for `ZLIB_LIBS` to override `-lz`. - Omit object files when building examples. - Default `CC` to `gcc` once again, for convenience. (Caveat: compiler name `cc` cannot be set now.) - Set `-DCURL_NO_OLDIES` for examples, like autotools does. - Delete `makefile.dj` files. Notice the configuration details and defaults are not retained with the new method. - Delete `makefile.amiga` files. A successful build needs a few custom options. We're also not retaining all build details from the existing Amiga make files. - Rename `Makefile.m32` to `Makefile.mk` to reflect that they are not Windows/MinGW32-specific anymore. - Add support for new `CFG` options: `-map`, `-debug`, `-trackmem` - Set `-DNDEBUG` by default. - Allow using `-DOS=...` in all `lib/config-*.h` headers, syncing this with `config-win32.h`. - Look for zlib parts in `ZLIB_PATH/include` and `ZLIB_PATH/lib` instead of bare `ZLIB_PATH`. Note that existing build configurations for MS-DOS and AmigaOS likely become incompatible with this change. Example AmigaOS configuration: ``` export CROSSPREFIX=/opt/amiga/bin/m68k-amigaos- export CC=gcc export CPPFLAGS='-DHAVE_PROTO_BSDSOCKET_H' export CFLAGS='-mcrt=clib2' export LDFLAGS="${CFLAGS}" export LIBS='-lnet -lm' make -C lib -f Makefile.mk make -C src -f Makefile.mk ``` Example MS-DOS configuration: ``` export CROSSPREFIX=/opt/djgpp/bin/i586-pc-msdosdjgpp- export WATT_PATH=/opt/djgpp/net/watt export ZLIB_PATH=/opt/djgpp export OPENSSL_PATH=/opt/djgpp export OPENSSL_LIBS='-lssl -lcrypt' export CFG=-zlib-ssl make -C lib -f Makefile.mk make -C src -f Makefile.mk ``` Closes #9764
2022-11-22 16:25:05 +08:00
### Rules
%$(BIN_EXT): %.c $(PROOT)/lib/libcurl.a
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@ $(LIBS)
Makefile.mk: portable Makefile.m32 Update bare GNU Make `Makefile.m32` to: - Move objects into a subdirectory. - Add support for MS-DOS. Tested with DJGPP. - Add support for Watt-32 (on MS-DOS). - Add support for AmigaOS. - Rename `Makefile.m32` to `Makefile.mk` - Replace `ARCH` with `TRIPLET`. - Build `tool_hugehelp.c` proper (when tools are available). - Drop MS-DOS compatibility macro `USE_ZLIB` (replaced by `HAVE_LIBZ`) - Add support for `ZLIB_LIBS` to override `-lz`. - Omit object files when building examples. - Default `CC` to `gcc` once again, for convenience. (Caveat: compiler name `cc` cannot be set now.) - Set `-DCURL_NO_OLDIES` for examples, like autotools does. - Delete `makefile.dj` files. Notice the configuration details and defaults are not retained with the new method. - Delete `makefile.amiga` files. A successful build needs a few custom options. We're also not retaining all build details from the existing Amiga make files. - Rename `Makefile.m32` to `Makefile.mk` to reflect that they are not Windows/MinGW32-specific anymore. - Add support for new `CFG` options: `-map`, `-debug`, `-trackmem` - Set `-DNDEBUG` by default. - Allow using `-DOS=...` in all `lib/config-*.h` headers, syncing this with `config-win32.h`. - Look for zlib parts in `ZLIB_PATH/include` and `ZLIB_PATH/lib` instead of bare `ZLIB_PATH`. Note that existing build configurations for MS-DOS and AmigaOS likely become incompatible with this change. Example AmigaOS configuration: ``` export CROSSPREFIX=/opt/amiga/bin/m68k-amigaos- export CC=gcc export CPPFLAGS='-DHAVE_PROTO_BSDSOCKET_H' export CFLAGS='-mcrt=clib2' export LDFLAGS="${CFLAGS}" export LIBS='-lnet -lm' make -C lib -f Makefile.mk make -C src -f Makefile.mk ``` Example MS-DOS configuration: ``` export CROSSPREFIX=/opt/djgpp/bin/i586-pc-msdosdjgpp- export WATT_PATH=/opt/djgpp/net/watt export ZLIB_PATH=/opt/djgpp export OPENSSL_PATH=/opt/djgpp export OPENSSL_LIBS='-lssl -lcrypt' export CFG=-zlib-ssl make -C lib -f Makefile.mk make -C src -f Makefile.mk ``` Closes #9764
2022-11-22 16:25:05 +08:00
all: $(TARGETS)