home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 3 / RISC_DISC_3.iso / resources / etexts / gems / gemsv / ch7_6 / matrix / makefile. next >
Makefile  |  1995-01-27  |  1KB  |  50 lines

  1. # An ANSI C compiler: gnu's "gcc"
  2. CC = gcc
  3.  
  4. # The UNIX flag must be defined for UNIX implementations
  5. #CPPFLAGS = -DUNIX -DX11 -I.
  6.  
  7. # Very important!  The first flag (struct-return) makes it safe to link
  8. #  gcc objects with cc objects.
  9. GCCFLAGS = -fpcc-struct-return 
  10.  
  11. # Object files wiil go in this subdirectory
  12. OBJ_DIR         =  .
  13.  
  14. # User-defined; to pass options in to the compilation, say things
  15. #   like 'make CFLAGS=-g'.  Put flags here to make them permanent.
  16.  
  17. CFLAGS     = -O2
  18.  
  19. #####################################################################
  20.  
  21. TARGET = libmat.a
  22.  
  23. HFILES =             \
  24. mat3.h            
  25.  
  26. OBJECTS = mat3.o      
  27.  
  28. #####################################################################
  29.  
  30.  
  31. PATH_OBJECTS =  $(OBJECTS:%=$(OBJ_DIR)/%)
  32.  
  33. $(OBJ_DIR)/%.o: %.c
  34.     $(CC) $(GCCFLAGS) $(CFLAGS) -c -o $(OBJ_DIR)/$*.o $*.c
  35.  
  36. $(TARGET):  $(PATH_OBJECTS)
  37.     echo $(PATH_OBJECTS)
  38.     ar rv $(TARGET) $(PATH_OBJECTS)
  39.     ranlib $(TARGET)
  40.  
  41. remove:
  42.     /bin/rm -f $(PATH_OBJECTS)
  43.     /bin/rm -f *~
  44.  
  45. clean:  remove $(TARGET)
  46.  
  47. $(PATH_OBJECTS): $(HFILES)
  48.  
  49.  
  50.