home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / config / amiga / makefile < prev   
Encoding:
Makefile  |  1997-02-07  |  956 b   |  47 lines

  1. TOP=../..
  2.  
  3. USER_INCLUDES=-I$(TOP)/graphics -I$(TOP)/intuition
  4.  
  5. include $(TOP)/config/make.cfg
  6.  
  7. ifeq ($(FLAVOUR),native)
  8. SUBDIRS = boot
  9.  
  10. FILES =
  11.  
  12. else
  13. SUBDIRS =
  14.  
  15. FILES = graphics_driver intuition_driver
  16. endif
  17.  
  18. all: setup subdirs \
  19.     $(foreach f,$(FILES),$(OSGENDIR)/$(f).o)
  20.  
  21. setup :
  22.     @if [ ! -d $(OSGENDIR) ]; then $(MKDIR) $(OSGENDIR) ; else true ; fi
  23.  
  24. clean:
  25.     $(RM) $(OSGENDIR) *.err
  26.  
  27. $(OSGENDIR)/%.o: %.c
  28.     $(CC) $(CFLAGS) $(GUI_CCFLAGS) $< -c -o $@ 2>&1|tee $*.err
  29.     @if test ! -s $*.err; then rm $*.err ; else true ; fi
  30.  
  31. $(OSGENDIR)/%.d: %.c
  32.     @if [ ! -d $(@D) ]; then $(MKDIR) $(@D) ; else true ; fi
  33.     $(MKDEPEND) -f- -p$(@D)/ -- $(CFLAGS) -- $^ > $@
  34.  
  35. subdirs:
  36.     @for dir in $(SUBDIRS) ; do \
  37.         echo "Making all in $$dir..." ; \
  38.         if ( cd $$dir ; \
  39.         $(MAKE) $(MFLAGS) TOP="../../.." CURDIR="$(CURDIR)/$$dir"\
  40.         all ) ; \
  41.         then echo -n ; else exit 1 ; fi ; \
  42.     done
  43.  
  44. ifneq ($(FLAVOUR),native)
  45. include $(foreach f,$(FILES),$(OSGENDIR)/$(f).d)
  46. endif
  47.