home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / compiler / aros / makefile < prev    next >
Encoding:
Makefile  |  1997-02-07  |  1.5 KB  |  72 lines

  1. # $Id: makefile,v 1.29 1997/02/07 15:25:44 digulla Exp $
  2. TOP=../..
  3.  
  4. include $(TOP)/config/make.cfg
  5.  
  6. OBJDIR=$(GENDIR)/aros
  7.  
  8. FILES = calcchecksum kprintf nastyfreemem \
  9.     purify removeslist debugmem \
  10.     _kprintf hexdump \
  11.     freestruct \
  12.     readbyte \
  13.     readdouble \
  14.     readfloat \
  15.     readlong \
  16.     readstring \
  17.     readstruct \
  18.     readword \
  19.     writebyte \
  20.     writedouble \
  21.     writefloat \
  22.     writelong \
  23.     writestring \
  24.     writestruct \
  25.     writeword
  26.  
  27. INCLUDE_FILES = $(wildcard include/*.h)
  28. DEST_INCLUDE_FILES = $(subst include,$(INCDIR)/aros,$(INCLUDE_FILES))
  29.  
  30. all: setup $(LIBDIR)/libaros.a
  31.  
  32. setup : make-dirs os-include
  33.  
  34. os-include: $(DEST_INCLUDE_FILES)
  35.  
  36. $(INCDIR)/aros/%.h: include/%.h
  37.     $(CP) $< $@
  38.  
  39. make-dirs :
  40.     @if [ ! -d $(OBJDIR) ]; then $(MKDIR) $(OBJDIR) ; else true ; fi
  41.     @if [ ! -d $(INCDIR) ]; then $(MKDIR) $(INCDIR) ; else true ; fi
  42.  
  43. clean:
  44.     -$(RM) $(OBJDIR) *.err $(LIBDIR)/libaros.a
  45.  
  46. $(OBJDIR)/%.o: %.c
  47.     $(SYS_CC) $(CFLAGS) $< -c -o $@ 2>&1|tee $*.err
  48.     @if test ! -s $*.err; then rm $*.err; else true ; fi
  49.  
  50. $(OBJDIR)/rt_stubs.o: rt_stubs.s
  51.     $(SYS_AS) $(AFLAGS) $< -c -o $@ 2>&1|tee $*.err
  52.     @if test ! -s $*.err; then rm $*.err; else true ; fi
  53.  
  54. $(LIBDIR)/libaros.a: $(foreach f,$(FILES),$(OBJDIR)/$(f).o)
  55.     $(AR) $@ $?
  56.     $(RANLIB) $@
  57.  
  58. $(OBJDIR)/%.d: %.c
  59.     @if [ ! -d $(@D) ]; then $(MKDIR) $(@D) ; else true ; fi
  60.     $(MKDEPEND) -f- -p$(@D)/ -- $(APPCFLAGS) -- $^ > $@
  61.  
  62. ifeq ($(TARGET),clean)
  63. NODEPS:=yes
  64. endif
  65. ifeq ($(TARGET),setup)
  66. NODEPS:=yes
  67. endif
  68.  
  69. ifndef NODEPS
  70. include $(foreach f,$(FILES),$(OBJDIR)/$(f).d)
  71. endif
  72.