added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / tools / toollib / Makefile
blob155ac3ce261f3f8d9556309fd87d611a07cd83ae
1 # Copyright © 1995-2001, The AROS Development Team. All rights reserved.
2 # $Id$
4 # Desc: Make the tool library.
6 SRC = error filesup hash lineparser mystream \
7 stdiocb stringcb toollib vstring
9 # Include the AROS build information. This will fail if $(TOP) is not
10 # set, and build in the current directory.
11 -include $(TOP)/config/make.cfg
13 # Values relating to stuff.
14 PURIFY = /home/digulla/AROS/compiler/purify/purify
16 # If the include above doesn't work, we need some defaults.
17 HOST_CC ?= $(CC)
18 HOST_AR ?= $(AR) cru
19 TOOLDIR ?= .
20 MKDIR ?= mkdir
21 MECHO ?= echo
22 TOOLLIB ?= $(TOOLDIR)/libtool.a
23 HOST_CFLAGS := $(HOST_CFLAGS) -Wall -g -DHAVE_VSNPRINTF -I.. -O
25 OBJDIR := $(TOOLDIR)/obj
26 DEPS := $(foreach f,$(SRC),$(OBJDIR)/$(f).d)
28 all : depend $(OBJDIR) $(TOOLLIB)
30 $(TOOLLIB) : $(foreach f,$(SRC),$(OBJDIR)/$(f).o)
31 @$(MECHO) "Creating toollib/$(notdir $@)..."
32 @$(HOST_AR) $@ $?
34 $(OBJDIR)/%.o : %.c
35 @$(MECHO) "Compiling toollib/$(notdir $@)..."
36 @$(HOST_CC) $(HOST_CFLAGS) -o $@ -c $<
38 $(OBJDIR)/%.d : %.c
39 @$(MECHO) Finding dependencies for $<...
40 @$(MKDIR) -p $(dir $@)
41 @$(HOST_CC) $(HOST_CFLAGS) -M $< > $@
43 $(OBJDIR) :
44 @$(MKDIR) $(OBJDIR)
46 pure :
47 -@rm *.o
48 @$(MAKE) "CC=$(PURIFY) $(CC)"
50 clean :
51 -@$(RM) -r $(OBJDIR) $(TOOLLIB)
52 @sed '/^# DO NOT DELETE$$/,$$d' Makefile > Makefile.tmp
53 @echo "# DO NOT DELETE" >> Makefile.tmp
54 @mv -f Makefile.tmp Makefile
55 -@$(RM) Makefile.bak
57 depend : $(DEPS)
59 -include $(DEPS)