home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 9 / FreshFishVol9-CD2.bin / bbs / gnu / libnix-0.8-src.lha / libnix-0.8 / sources / makefile < prev   
Encoding:
Makefile  |  1995-03-23  |  2.1 KB  |  72 lines

  1. # Built one model of the libnix libraries - use
  2. # make CFLAGS="what you like" to built them.
  3. #
  4. # Combine
  5. #
  6. # CFLAGS=-Wall -O3 -DOS_20_ONLY
  7. #
  8. #   -fbaserel -DSMALL_DATA    for small data model
  9. #   -mc68020            for 68020 specific code
  10. #   -mc68881            for 68881 specific code
  11. #   -DIXPATHS            for Un*x path option
  12. #   -DDEBUG_LIB            build a library for debugging (not recommended)
  13. #   -DOS_20_ONLY        disable some 1.3 compatibilities (use always)
  14.  
  15. SOURCEDIR=../sources
  16.  
  17. MAKELIST=make -f ../makefile filelist
  18.  
  19. SUBDIRS=nixmain nix_main misc nix math stubs
  20.  
  21. all: $(SUBDIRS)
  22.     for subdir in $(SUBDIRS); do \
  23.     ( cd $$subdir;make -f ../$(SOURCEDIR)/$$subdir/makefile V="$(V)" \
  24.       CFLAGS="$(CFLAGS)" ); \
  25.     done
  26.  
  27. $(SUBDIRS):
  28.     mkdir $@
  29.  
  30. libamiga: amiga
  31.     cd amiga;make -f ../$(SOURCEDIR)/amiga/makefile CFLAGS="$(CFLAGS)"
  32.  
  33. filelists:
  34.     -cd math;    $(MAKELIST) SOURCEFILES="*/*"
  35.     -cd nix;    $(MAKELIST) SOURCEFILES="*/*"
  36.     -cd stubs;    make -f ../makefile libbases/dos.c; \
  37.             $(MAKELIST) SOURCEFILES="libbases/* misc/* libnames/* stubs/*"
  38.     -cd amiga;    $(MAKELIST) SOURCEFILES="*/*"
  39.  
  40. filelist:
  41.     echo "#Computer generated partial makefile-do not edit" >filelist
  42.     echo "OBJECTS= \\" >>filelist
  43.     ls $(SOURCEFILES)|gawk '{ print substr($$0,1,length($$0)-2) ".o \\" }' >>filelist
  44.     echo >>filelist
  45.     echo "SUBDIRS= \\" >>filelist
  46.     ls -d -F *|gawk '/\// { print substr($$0,1,length($$0)-1) " \\" }' >>filelist
  47.  
  48. # build stubs for library base pointers
  49. libbases/dos.c: ../makefile library.list
  50.     -rm libbases/* libnames/*
  51.     gawk <library.list '{ sname=substr($$2,1,length($$2)-8);    \
  52.       fname="libbases/" sname ".c";                    \
  53.       print "/* Machine-generated C-file- do not edit ! */"    >fname;    \
  54.       print "#include <stabs.h>"                >fname;    \
  55.       print "extern char __" sname "name[];"        >fname;    \
  56.       print "void *" $$1 "[2]={ 0l,__" sname "name };"    >fname;    \
  57.       print "ADD2LIB(" $$1 ");"                >fname;    \
  58.       fname="libnames/" sname ".c";                    \
  59.       print "/* Machine-generated C-file- do not edit ! */"    >fname;    \
  60.       print "char __" sname "name[]=\"" $$2 "\";"        >fname;}'
  61.     
  62. clean:
  63.     cd nixmain;    make clean
  64.     cd nix_main;    make clean
  65.     cd misc;    make clean
  66.     cd math;    make clean
  67.     cd nix;        make clean
  68.     cd stubs;    make clean
  69.  
  70. veryclean:
  71.     -rm -r *
  72.