• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#***************************************************************************
2#                                  _   _ ____  _
3#  Project                     ___| | | |  _ \| |
4#                             / __| | | | |_) | |
5#                            | (__| |_| |  _ <| |___
6#                             \___|\___/|_| \_\_____|
7#
8# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
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
12# are also available at https://curl.se/docs/copyright.html.
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# SPDX-License-Identifier: curl
22#
23#***************************************************************************
24
25# Build libcurl via lib/Makefile.mk first.
26
27PROOT := ../..
28
29ifeq ($(findstring -static,$(CFG)),)
30  DYN := 1
31endif
32
33### Common
34
35include $(PROOT)/lib/Makefile.mk
36
37### Local
38
39CPPFLAGS += -DCURL_NO_OLDIES
40LDFLAGS  += -L$(PROOT)/lib
41LIBS     := -lcurl $(LIBS)
42
43ifdef DYN
44  curl_DEPENDENCIES += $(PROOT)/lib/libcurl.dll.a
45else
46  curl_DEPENDENCIES := $(PROOT)/lib/libcurl.a
47  ifdef WIN32
48    CPPFLAGS += -DCURL_STATICLIB
49    LDFLAGS += -static
50  endif
51endif
52
53ifdef WIN32
54  LIBS += -lws2_32
55endif
56
57### Sources and targets
58
59# Provides check_PROGRAMS
60include Makefile.inc
61
62ifdef WIN32
63check_PROGRAMS += synctime
64endif
65
66TARGETS := $(patsubst %,%$(BIN_EXT),$(strip $(check_PROGRAMS)))
67TOCLEAN := $(TARGETS)
68
69### Rules
70
71%$(BIN_EXT): %.c $(curl_DEPENDENCIES)
72	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(CURL_LDFLAGS_BIN) $< -o $@ $(LIBS)
73
74all: $(TARGETS)
75