#
#        Makefile for IntuiSup-Library (Aztec C v5.2a)
#
# Macros
#
DATE       =ram:compile_date.i
SYMBOLS    =ram:lib.pre
CFLAGS_PRE =-a -ms -pacs0t -so -wdelopqw -ho $(SYMBOLS)
CFLAGS_LIB =-mbs -pacs0t -so -wdelopqw -hi $(SYMBOLS)
CFLAGS     =-ms -pacs0t -so -wdelopqw -hi $(SYMBOLS)
AFLAGS     =
LFLAGS     =-m +q
LIBRARY    =/library
RENDER     =/render
TEXTS      =/texts
BORDERS    =/borders
GADGETS    =/gadgets
REQUESTER  =/requester
MENUS      =/menus
FILES      =/files
LANGUAGE   =/language
POINTER    =/pointer
EDITOR     =/editor
STARTUP    =libstartup.o libinit.o
OBJECTS    =$(RENDER)/render.o $(TEXTS)/texts.o $(BORDERS)/borders.o\
 $(GADGETS)/gadgets1.o $(GADGETS)/gadgets2.o $(GADGETS)/gadgets3.o\
 $(GADGETS)/gadgets4.o $(REQUESTER)/requester.o $(MENUS)/menus.o\
 $(FILES)/files.o $(LANGUAGE)/language.o $(POINTER)/pointer.o
LIBRARIES  =-lc16
#
# Dependancy entries
#
all: $(SYMBOLS) intuisup.library library_test library_test2 clear
#
$(SYMBOLS): lib.pre
   copy lib.pre $@ clone
#
lib.pre: includes.h
   cc $(CFLAGS_PRE) -o nil: includes.h
   copy $(SYMBOLS) $@ clone
#
libstartup.o: $(DATE) libdata.i
   as $*.asm
#
$(DATE):
   printdate >$(DATE) format "*tdc.b*t\q (\a \d \t)\q,13,10,0"
#
intuisup.library: $(DATE) $(STARTUP) $(OBJECTS)
   ln $(LFLAGS) -o $@ $(STARTUP) $(OBJECTS) $(LIBRARIES)
   delete $(DATE)
   copy $@ libs: clone
   copy intuisup#?.h sys:aztecc/include/libraries/ clone
#
library_test: library_test.o
   ln $(LFLAGS) -o $@ library_test.o $(LIBRARIES)
#
library_test2: library_test2.o
   ln $(LFLAGS) -o $@ library_test2.o $(LIBRARIES)
#
libinit.o: libinit.c
   cc $(CFLAGS_LIB) libinit.c
#
$(RENDER)/render.o: $(RENDER)/render.c
   cd $(RENDER)
   make ram:render.pre render.o
   delete ram:render.pre
   cd $(LIBRARY)
#
$(TEXTS)/texts.o: $(TEXTS)/texts.c
   cd $(TEXTS)
   make ram:texts.pre texts.o
   delete ram:texts.pre
   cd $(LIBRARY)
#
$(BORDERS)/borders.o: $(BORDERS)/borders.c
   cd $(BORDERS)
   make ram:borders.pre borders.o
   delete ram:borders.pre
   cd $(LIBRARY)
#
$(GADGETS)/gadgets1.o: $(GADGETS)/gadgets1.c
   cd $(GADGETS)
   make ram:gadgets.pre gadgets1.o
   delete ram:gadgets.pre
   cd $(LIBRARY)
#
$(GADGETS)/gadgets2.o: $(GADGETS)/gadgets2.c
   cd $(GADGETS)
   make ram:gadgets.pre gadgets2.o
   delete ram:gadgets.pre
   cd $(LIBRARY)
#
$(GADGETS)/gadgets3.o: $(GADGETS)/gadgets3.c
   cd $(GADGETS)
   make ram:gadgets.pre gadgets3.o
   delete ram:gadgets.pre
   cd $(LIBRARY)
#
$(REQUESTER)/requester.o: $(REQUESTER)/requester.c
   cd $(REQUESTER)
   make ram:requester.pre requester.o
   delete ram:requester.pre
   cd $(LIBRARY)
#
$(MENUS)/menus.o: $(MENUS)/menus.c
   cd $(MENUS)
   make ram:menus.pre menus.o
   delete ram:menus.pre
   cd $(LIBRARY)
#
$(FILES)/files.o: $(FILES)/files.c
   cd $(FILES)
   make ram:files.pre files.o
   delete ram:files.pre
   cd $(LIBRARY)
#
$(LANGUAGE)/language.o: $(LANGUAGE)/language.c
   cd $(LANGUAGE)
   make ram:language.pre language.o
   delete ram:language.pre
   cd $(LIBRARY)
#
$(POINTER)/pointer.o: $(POINTER)/pointer.c
   cd $(POINTER)
   make ram:pointer.pre pointer.o
   delete ram:pointer.pre
   cd $(LIBRARY)
#
clear:
   delete ram:#?.pre
#
full:
#  First turn - create objects for library and test files
   cd $(RENDER)
   make
   cd $(TEXTS)
   @make
   cd $(BORDERS)
   @make
   cd $(GADGETS)
   @make
   cd $(REQUESTER)
   @make
   cd $(MENUS)
   @make
   cd $(FILES)
   @make
   cd $(LANGUAGE)
   @make
   cd $(POINTER)
   @make
   cd $(EDITOR)
   @make
#  Second turn - link test files with modified object files
   cd $(RENDER)
   @make
   cd $(TEXTS)
   @make
   cd $(BORDERS)
   @make
   cd $(GADGETS)
   @make
   cd $(REQUESTER)
   @make
   cd $(MENUS)
   @make
   cd $(FILES)
   @make
   cd $(LANGUAGE)
   @make
   cd $(POINTER)
   @make
   cd $(EDITOR)
   @make
#  Create library
   cd $(LIBRARY)
   make
#
archive:
   cd /
   lha -r -x u source ~(ReadMe|*.doc|*.guide|*_test|*_test2|editor|*.library|unnamed.c|unnamed|*.o|*.pre)
   cd library
#
cleanup:
   delete ram:#?.pre
   delete (#?.o|#?.pre)
   delete $(RENDER)/(#?.o|#?.pre)
   delete $(TEXTS)/(#?.o|#?.pre)
   delete $(BORDERS)/(#?.o|#?.pre)
   delete $(GADGETS)/(#?.o|#?.pre)
   delete $(REQUESTER)/(#?.o|#?.pre)
   delete $(MENUS)/(#?.o|#?.pre)
   delete $(FILES)/(#?.o|#?.pre)
   delete $(LANGUAGE)/(#?.o|#?.pre)
   delete $(POINTER)/(#?.o|#?.pre)
   delete $(EDITOR)/(#?.o|#?.pre)
#
