Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1 | #*************************************************************************** |
| 2 | # _ _ ____ _ |
| 3 | # Project ___| | | | _ \| | |
| 4 | # / __| | | | |_) | | |
| 5 | # | (__| |_| | _ <| |___ |
| 6 | # \___|\___/|_| \_\_____| |
| 7 | # |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 8 | # Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 9 | # |
| 10 | # This software is licensed as described in the file COPYING, which |
| 11 | # you should have received as part of this distribution. The terms |
Alex Deymo | 8f1a214 | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 12 | # are also available at https://curl.haxx.se/docs/copyright.html. |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 13 | # |
| 14 | # You may opt to use, copy, modify, merge, publish, distribute and/or sell |
| 15 | # copies of the Software, and permit persons to whom the Software is |
| 16 | # furnished to do so, under the terms of the COPYING file. |
| 17 | # |
| 18 | # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 19 | # KIND, either express or implied. |
| 20 | # |
| 21 | ########################################################################### |
| 22 | AUTOMAKE_OPTIONS = foreign nostdinc |
| 23 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 24 | CMAKE_DIST = CMakeLists.txt curl_config.h.cmake |
| 25 | |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 26 | EXTRA_DIST = Makefile.b32 Makefile.m32 config-win32.h \ |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 27 | config-win32ce.h config-riscos.h config-mac.h curl_config.h.in \ |
| 28 | makefile.dj config-dos.h libcurl.plist libcurl.rc config-amigaos.h \ |
| 29 | makefile.amiga Makefile.netware nwlib.c nwos.c config-win32ce.h \ |
| 30 | config-os400.h setup-os400.h config-symbian.h Makefile.Watcom \ |
| 31 | config-tpf.h mk-ca-bundle.pl mk-ca-bundle.vbs $(CMAKE_DIST) \ |
| 32 | firefox-db2pem.sh config-vxworks.h Makefile.vxworks checksrc.pl \ |
Alex Deymo | 8f1a214 | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 33 | objnames-test08.sh objnames-test10.sh objnames.inc |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 34 | |
| 35 | lib_LTLIBRARIES = libcurl.la |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 36 | |
| 37 | if BUILD_UNITTESTS |
| 38 | noinst_LTLIBRARIES = libcurlu.la |
| 39 | else |
| 40 | noinst_LTLIBRARIES = |
| 41 | endif |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 42 | |
| 43 | # This might hold -Werror |
| 44 | CFLAGS += @CURL_CFLAG_EXTRAS@ |
| 45 | |
| 46 | # Specify our include paths here, and do it relative to $(top_srcdir) and |
| 47 | # $(top_builddir), to ensure that these paths which belong to the library |
| 48 | # being currently built and tested are searched before the library which |
| 49 | # might possibly already be installed in the system. |
| 50 | # |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 51 | # $(top_srcdir)/include is for libcurl's external include files |
| 52 | # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 53 | # $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "private" files |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 54 | # $(top_builddir)/ares is for in-tree c-ares's generated ares_build.h file |
| 55 | # $(top_srcdir)/ares is for in-tree c-ares's external include files |
| 56 | |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 57 | AM_CPPFLAGS = -I$(top_srcdir)/include \ |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 58 | -I$(top_builddir)/lib \ |
| 59 | -I$(top_srcdir)/lib |
| 60 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 61 | if USE_EMBEDDED_ARES |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 62 | AM_CPPFLAGS += -I$(top_builddir)/ares \ |
| 63 | -I$(top_srcdir)/ares |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 64 | endif |
| 65 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 66 | # Prevent LIBS from being used for all link targets |
| 67 | LIBS = $(BLANK_AT_MAKETIME) |
| 68 | |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 69 | VERSIONINFO=-version-info 9:0:5 |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 70 | # This flag accepts an argument of the form current[:revision[:age]]. So, |
| 71 | # passing -version-info 3:12:1 sets current to 3, revision to 12, and age to |
| 72 | # 1. |
| 73 | # |
| 74 | # Here's the simplified rule guide on how to change -version-info: |
| 75 | # (current version is C:R:A) |
| 76 | # |
| 77 | # 1. if there are only source changes, use C:R+1:A |
| 78 | # 2. if interfaces were added use C+1:0:A+1 |
| 79 | # 3. if interfaces were removed, then use C+1:0:0 |
| 80 | # |
| 81 | # For the full guide on libcurl ABI rules, see docs/libcurl/ABI |
| 82 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 83 | AM_CPPFLAGS += -DBUILDING_LIBCURL |
| 84 | AM_LDFLAGS = |
| 85 | AM_CFLAGS = |
| 86 | |
| 87 | libcurl_la_CPPFLAGS_EXTRA = |
| 88 | libcurl_la_LDFLAGS_EXTRA = |
| 89 | libcurl_la_CFLAGS_EXTRA = |
| 90 | |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 91 | @CODE_COVERAGE_RULES@ |
| 92 | libcurl_la_LDFLAGS_EXTRA += $(CODE_COVERAGE_LDFLAGS) |
| 93 | libcurl_la_CFLAGS_EXTRA += $(CODE_COVERAGE_CFLAGS) |
| 94 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 95 | if CURL_LT_SHLIB_USE_VERSION_INFO |
| 96 | libcurl_la_LDFLAGS_EXTRA += $(VERSIONINFO) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 97 | endif |
| 98 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 99 | if CURL_LT_SHLIB_USE_NO_UNDEFINED |
| 100 | libcurl_la_LDFLAGS_EXTRA += -no-undefined |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 101 | endif |
| 102 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 103 | if CURL_LT_SHLIB_USE_MIMPURE_TEXT |
| 104 | libcurl_la_LDFLAGS_EXTRA += -mimpure-text |
| 105 | endif |
| 106 | |
| 107 | if CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS |
| 108 | libcurl_la_LDFLAGS_EXTRA += -Wl,--version-script=libcurl.vers |
Elliott Hughes | 0128fe4 | 2018-02-27 14:57:55 -0800 | [diff] [blame] | 109 | else |
| 110 | libcurl_la_LDFLAGS_EXTRA += -export-symbols-regex '^curl_.*' |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 111 | endif |
| 112 | |
| 113 | if USE_CPPFLAG_CURL_STATICLIB |
| 114 | libcurl_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB |
| 115 | endif |
| 116 | |
| 117 | if DOING_CURL_SYMBOL_HIDING |
| 118 | libcurl_la_CPPFLAGS_EXTRA += -DCURL_HIDDEN_SYMBOLS |
| 119 | libcurl_la_CFLAGS_EXTRA += $(CFLAG_CURL_SYMBOL_HIDING) |
| 120 | endif |
| 121 | |
| 122 | libcurl_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcurl_la_CPPFLAGS_EXTRA) |
| 123 | libcurl_la_LDFLAGS = $(AM_LDFLAGS) $(libcurl_la_LDFLAGS_EXTRA) $(LDFLAGS) $(LIBCURL_LIBS) |
| 124 | libcurl_la_CFLAGS = $(AM_CFLAGS) $(libcurl_la_CFLAGS_EXTRA) |
| 125 | |
| 126 | libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS |
| 127 | libcurlu_la_LDFLAGS = $(AM_LDFLAGS) -static $(LIBCURL_LIBS) |
| 128 | libcurlu_la_CFLAGS = $(AM_CFLAGS) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 129 | |
| 130 | # Makefile.inc provides the CSOURCES and HHEADERS defines |
| 131 | include Makefile.inc |
| 132 | |
| 133 | libcurl_la_SOURCES = $(CSOURCES) $(HHEADERS) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 134 | libcurlu_la_SOURCES = $(CSOURCES) $(HHEADERS) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 135 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 136 | checksrc: |
Alex Deymo | 8f1a214 | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 137 | @PERL@ $(srcdir)/checksrc.pl -D$(srcdir) -W$(srcdir)/curl_config.h \ |
| 138 | $(srcdir)/*.[ch] $(srcdir)/vauth/*.[ch] $(srcdir)/vtls/*.[ch] |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 139 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 140 | if CURLDEBUG |
| 141 | # for debug builds, we scan the sources on all regular make invokes |
| 142 | all-local: checksrc |
| 143 | endif |