xref: /aosp_15_r20/external/curl/docs/examples/Makefile.example (revision 6236dae45794135f37c4eb022389c904c8b0090d)
1*6236dae4SAndroid Build Coastguard Worker#***************************************************************************
2*6236dae4SAndroid Build Coastguard Worker#                                  _   _ ____  _
3*6236dae4SAndroid Build Coastguard Worker#  Project                     ___| | | |  _ \| |
4*6236dae4SAndroid Build Coastguard Worker#                             / __| | | | |_) | |
5*6236dae4SAndroid Build Coastguard Worker#                            | (__| |_| |  _ <| |___
6*6236dae4SAndroid Build Coastguard Worker#                             \___|\___/|_| \_\_____|
7*6236dae4SAndroid Build Coastguard Worker#
8*6236dae4SAndroid Build Coastguard Worker# Copyright (C) Daniel Stenberg, <[email protected]>, et al.
9*6236dae4SAndroid Build Coastguard Worker#
10*6236dae4SAndroid Build Coastguard Worker# This software is licensed as described in the file COPYING, which
11*6236dae4SAndroid Build Coastguard Worker# you should have received as part of this distribution. The terms
12*6236dae4SAndroid Build Coastguard Worker# are also available at https://curl.se/docs/copyright.html.
13*6236dae4SAndroid Build Coastguard Worker#
14*6236dae4SAndroid Build Coastguard Worker# You may opt to use, copy, modify, merge, publish, distribute and/or sell
15*6236dae4SAndroid Build Coastguard Worker# copies of the Software, and permit persons to whom the Software is
16*6236dae4SAndroid Build Coastguard Worker# furnished to do so, under the terms of the COPYING file.
17*6236dae4SAndroid Build Coastguard Worker#
18*6236dae4SAndroid Build Coastguard Worker# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19*6236dae4SAndroid Build Coastguard Worker# KIND, either express or implied.
20*6236dae4SAndroid Build Coastguard Worker#
21*6236dae4SAndroid Build Coastguard Worker# SPDX-License-Identifier: curl
22*6236dae4SAndroid Build Coastguard Worker#
23*6236dae4SAndroid Build Coastguard Worker###########################################################################
24*6236dae4SAndroid Build Coastguard Worker
25*6236dae4SAndroid Build Coastguard Worker# What to call the final executable
26*6236dae4SAndroid Build Coastguard WorkerTARGET = example
27*6236dae4SAndroid Build Coastguard Worker
28*6236dae4SAndroid Build Coastguard Worker# Which object files that the executable consists of
29*6236dae4SAndroid Build Coastguard WorkerOBJS= ftpget.o
30*6236dae4SAndroid Build Coastguard Worker
31*6236dae4SAndroid Build Coastguard Worker# What compiler to use
32*6236dae4SAndroid Build Coastguard WorkerCC = gcc
33*6236dae4SAndroid Build Coastguard Worker
34*6236dae4SAndroid Build Coastguard Worker# Compiler flags, -g for debug, -c to make an object file
35*6236dae4SAndroid Build Coastguard WorkerCFLAGS = -c -g
36*6236dae4SAndroid Build Coastguard Worker
37*6236dae4SAndroid Build Coastguard Worker# This should point to a directory that holds libcurl, if it is not
38*6236dae4SAndroid Build Coastguard Worker# in the system's standard lib dir
39*6236dae4SAndroid Build Coastguard Worker# We also set a -L to include the directory where we have the OpenSSL
40*6236dae4SAndroid Build Coastguard Worker# libraries
41*6236dae4SAndroid Build Coastguard WorkerLDFLAGS = -L/home/dast/lib -L/usr/local/ssl/lib
42*6236dae4SAndroid Build Coastguard Worker
43*6236dae4SAndroid Build Coastguard Worker# We need -lcurl for the curl stuff
44*6236dae4SAndroid Build Coastguard Worker# We need -lsocket and -lnsl when on Solaris
45*6236dae4SAndroid Build Coastguard Worker# We need -lssl and -lcrypto when using libcurl with SSL support
46*6236dae4SAndroid Build Coastguard Worker# We need -lpthread for the pthread example
47*6236dae4SAndroid Build Coastguard WorkerLIBS = -lcurl -lsocket -lnsl -lssl -lcrypto
48*6236dae4SAndroid Build Coastguard Worker
49*6236dae4SAndroid Build Coastguard Worker# Link the target with all objects and libraries
50*6236dae4SAndroid Build Coastguard Worker$(TARGET) : $(OBJS)
51*6236dae4SAndroid Build Coastguard Worker	$(CC)  -o $(TARGET) $(OBJS) $(LDFLAGS) $(LIBS)
52*6236dae4SAndroid Build Coastguard Worker
53*6236dae4SAndroid Build Coastguard Worker# Compile the source files into object files
54*6236dae4SAndroid Build Coastguard Workerftpget.o : ftpget.c
55*6236dae4SAndroid Build Coastguard Worker	$(CC) $(CFLAGS) $<
56