blob: 989ac65223d74b61bb9f10bbf8bc62b4c3b72d12 [file] [log] [blame]
Daniel Stenbergde7bdb52002-03-25 14:42:44 +00001############################################################################
2# __________ __ ___.
3# Open \______ \ ____ ____ | | _\_ |__ _______ ___
4# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7# \/ \/ \/ \/ \/
Daniel Stenberg1c51bab2002-03-25 14:43:36 +00008# $Id$
Daniel Stenbergde7bdb52002-03-25 14:42:44 +00009#
10# Copyright (C) 2002 by Daniel Stenberg <daniel@haxx.se>
11#
12# All files in this archive are subject to the GNU General Public License.
13# See the file COPYING in the source tree root for full license agreement.
14#
15# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16# KIND, either express or implied.
17#
18############################################################################
Daniel Stenberg9f6733f2002-03-25 14:21:30 +000019
Linus Nielsen Feltzing865effa2004-07-23 21:06:03 +000020SIMCOMMON = ../common
Linus Nielsen Feltzing7f22b842002-09-03 08:30:15 +000021
Daniel Stenbergcdde25b2005-02-18 13:47:17 +000022DEPFILE = $(OBJDIR)/dep-sim
Daniel Stenbergfa266962002-04-11 12:41:27 +000023
Björn Stenberg63655742002-04-25 08:06:38 +000024RM = rm -f
25DEBUG = -g
Daniel Stenbergf7a6c452002-05-04 12:26:21 +000026
Daniel Stenbergcdde25b2005-02-18 13:47:17 +000027# Use this for simulator-only files
Daniel Stenbergb8a23f9e2005-05-07 22:41:17 +000028INCLUDES = -I. -I$(SIMCOMMON) -I$(OBJDIR) -I$(FIRMDIR)/export -I$(APPSDIR) \
29 -I$(BUILDDIR)
Daniel Stenbergcdde25b2005-02-18 13:47:17 +000030
Daniel Stenberg0bf50f02005-03-06 15:53:44 +000031# This sets up 'SRC' based on the files mentioned in SOURCES
32include $(TOOLSDIR)/makesrc.inc
33
Daniel Stenbergcdde25b2005-02-18 13:47:17 +000034OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
Daniel Stenbergf7da8db2002-05-31 07:23:07 +000035
Björn Stenberg8b695042004-09-16 14:36:08 +000036DEFINES := -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \
Jens Arnoldb4527a32005-02-11 23:56:38 +000037$(TARGET) -DAPPSVERSION=\"$(VERSION)\" -DMEM=${MEMORYSIZE} $(EXTRA_DEFINES)
Daniel Stenbergf7a6c452002-05-04 12:26:21 +000038
Daniel Stenbergcdde25b2005-02-18 13:47:17 +000039SOURCES = $(SRC)
Linus Nielsen Feltzing865effa2004-07-23 21:06:03 +000040
Daniel Stenbergcdde25b2005-02-18 13:47:17 +000041DIRS = .
Linus Nielsen Feltzing865effa2004-07-23 21:06:03 +000042
Daniel Stenbergcdde25b2005-02-18 13:47:17 +000043CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) $(GCCOPTS)
Björn Stenberg63655742002-04-25 08:06:38 +000044
Daniel Stenbergb8a23f9e2005-05-07 22:41:17 +000045OUTFILE = $(BUILDDIR)/libsim.a
Daniel Stenberg0c7ebc42002-06-17 13:33:47 +000046
Daniel Stenbergcdde25b2005-02-18 13:47:17 +000047all: $(OUTFILE)
Dave Chapmanebb57e82002-05-12 11:34:08 +000048
Daniel Stenbergcdde25b2005-02-18 13:47:17 +000049include $(TOOLSDIR)/make.inc
Daniel Stenberg9f6733f2002-03-25 14:21:30 +000050
51clean:
Daniel Stenbergcdde25b2005-02-18 13:47:17 +000052 @echo "cleaning sim"
53 @$(RM) $(OBJS) *~ core $(OUTFILE) $(DEPFILE)
54 @$(MAKE) -C $(SIMCOMMON) clean
Daniel Stenberg9f6733f2002-03-25 14:21:30 +000055
Daniel Stenbergcdde25b2005-02-18 13:47:17 +000056$(OUTFILE): $(OBJS)
57 @echo "AR $@"
58 @$(AR) ruv $@ $(OBJS) >/dev/null 2>&1
Daniel Stenberg0ab96fd2002-10-15 07:51:25 +000059
Daniel Stenbergcdde25b2005-02-18 13:47:17 +000060-include $(DEPFILE)