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

  1. # $Id: makefile,v 1.36 1997/02/07 14:32:21 digulla Exp $
  2. TOP=../..
  3.  
  4. # Use OS's own includes over the ones from AROS
  5. SPECIAL_CFLAGS=-I/usr/include
  6.  
  7. include $(TOP)/config/make.cfg
  8.  
  9. ifeq ($(FLAVOUR),native)
  10. FILES = execstrap_init
  11.  
  12. FUNCTIONS = \
  13.     initcode initstruct makelibrary makefunctions findresident initresident \
  14.     setintvector addintserver remintserver \
  15.     allocmem freemem availmem allocentry freeentry typeofmem \
  16.     addmemlist addmemhandler remmemhandler \
  17.     insert addhead addtail remove remhead remtail enqueue findname \
  18.     setsignal allocsignal freesignal \
  19.     addport remport waitport findport createmsgport deletemsgport \
  20.     putmsg getmsg replymsg \
  21.     doio sendio checkio waitio abortio createiorequest deleteiorequest \
  22.     addresource remresource openresource \
  23.     addlibrary remlibrary oldopenlibrary closelibrary \
  24.     setfunction sumlibrary openlibrary taggedopenlibrary \
  25.     adddevice remdevice \
  26.     findtask \
  27.     rawdofmt \
  28.     allocvec freevec \
  29.     initsemaphore attemptsemaphore findsemaphore addsemaphore remsemaphore \
  30.     obtainsemaphoreshared attemptsemaphoreshared
  31.  
  32. # Functions that are written in asm and need to be linked into exec.strap.
  33. # These are in config/$(KERNEL).
  34. ASMFUNCTIONS = forbid disable getcc cacheclearu cachepredma cachepostdma
  35.  
  36. else
  37. FILES = init execfunctions
  38.  
  39. FUNCTIONS = \
  40.     allocmem freemem addhead \
  41.     addtask remtask wait \
  42.     signal allocsignal freesignal \
  43.     alert freeentry remove \
  44.     remhead enqueue addmemhandler \
  45.     setexcept setsignal settaskpri \
  46.     findtask findname getmsg \
  47.     putmsg replymsg addtail \
  48.     waitport allocate addport \
  49.     remport findport addmemlist \
  50.     createmsgport deletemsgport \
  51.     createiorequest deallocate \
  52.     availmem deleteiorequest allocvec \
  53.     freevec allocabs allocentry \
  54.     createpool deletepool allocpooled \
  55.     remmemhandler initstruct \
  56.     initsemaphore attemptsemaphore \
  57.     obtainsemaphore obtainsemaphoreshared \
  58.     attemptsemaphoreshared releasesemaphore \
  59.     procure vacate \
  60.     addlibrary remlibrary \
  61.     makefunctions makelibrary \
  62.     sumlibrary openlibrary \
  63.     closelibrary setfunction \
  64.     oldopenlibrary copymemquick \
  65.     copymem freepooled \
  66.     remsemaphore addsemaphore \
  67.     releasesemaphorelist obtainsemaphorelist \
  68.     typeofmem rawdofmt insert \
  69.     remtail findsemaphore \
  70.     addresource \
  71.     remresource openresource \
  72.     adddevice remdevice opendevice \
  73.     closedevice doio sendio \
  74.     checkio abortio waitio \
  75.     initresident cause \
  76.     rawputchar addintserver \
  77.     remintserver setintvector \
  78.     alloctrap childfree childorphan childstatus childwait coldreboot \
  79.     debug findresident freetrap initcode sumkickdata obtainquickvector
  80. endif
  81.  
  82. ifeq ($(FLAVOUR),native)
  83. LIBS = -L$(LIBDIR) -larosc
  84.  
  85. all: setup \
  86.     $(foreach f,$(FILES),$(OSGENDIR)/$(f).o) \
  87.     $(foreach f,$(FUNCTIONS),$(OSGENDIR)/$(f).o) \
  88.     $(foreach f,$(FUNCTIONS),$(f).s) \
  89.     $(OSMODDIR)/exec.strap
  90.  
  91. $(OSMODDIR)/exec.strap: $(foreach f,$(FILES),$(OSGENDIR)/$(f).o) \
  92.                $(foreach f,$(FUNCTIONS),$(OSGENDIR)/$(f).o) \
  93.                $(foreach f,$(ASMFUNCTIONS),$(OSGENDIR)/$(f).o)
  94.     $(CC) $(ILDFLAGS) \
  95.     $(foreach f,$(FILES),$(OSGENDIR)/$(f).o) \
  96.     $(foreach f,$(FUNCTIONS),$(OSGENDIR)/$(f).o) \
  97.     $(foreach f,$(ASMFUNCTIONS),$(OSGENDIR)/$(f).o) \
  98.     $(LIBS) -o $@ 2>&1|tee execstrap.err
  99.     @if test ! -s execstrap.err; then rm execstrap.err ; else true ; fi
  100.     @strip $@
  101.  
  102. # To study the assembler output for evaluation (can be helpful in tracking
  103. # down bugs):
  104. %.s: %.c
  105.     $(CC) -S $(CFLAGS) $< -c -o $@
  106. else
  107. all: setup \
  108.     $(foreach f,$(FILES),$(OSGENDIR)/$(f).o) \
  109.     $(foreach f,$(FUNCTIONS),$(OSGENDIR)/$(f).o)
  110.  
  111. endif
  112.  
  113. setup :
  114.     @if [ ! -d $(OSGENDIR) ]; then $(MKDIR) $(OSGENDIR) ; else true ; fi
  115.     @if [ ! -d $(OSMODDIR) ]; then $(MKDIR) $(OSMODDIR) ; else true ; fi
  116.  
  117. clean:
  118.     $(RM) $(OSGENDIR) *.err $(LIBDIR)/libexec.a
  119.  
  120. $(OSGENDIR)/%.o: %.c
  121.     $(CC) $(SHARED_CFLAGS) $(CFLAGS) $< -c -o $@ 2>&1|tee $*.err
  122.     @if test ! -s $*.err; then rm $*.err ; else true ; fi
  123.  
  124. $(OSGENDIR)/%.d: %.c
  125.     @if [ ! -d $(@D) ]; then $(MKDIR) $(@D) ; else true ; fi
  126.     $(MKDEPEND) -f- -p$(@D)/ -- $(CFLAGS) -- $^ > $@
  127.  
  128. ifneq ($(TARGET),clean)
  129. include $(foreach f,$(FILES) $(FUNCTIONS),$(OSGENDIR)/$(f).d)
  130. endif
  131.