Makefile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #-------------------------------------------------------------------------------
  2. # AMD Makefile for compiling on Unix systems (for GNU make only)
  3. #-------------------------------------------------------------------------------
  4. default: libamd.a
  5. include ../../ecos.mk
  6. C = $(CC) $(CFLAGS) -Iinclude -I../SuiteSparse_config
  7. #-------------------------------------------------------------------------------
  8. # source files
  9. #-------------------------------------------------------------------------------
  10. AMD = amd_aat amd_1 amd_2 amd_dump amd_postorder amd_post_tree amd_defaults \
  11. amd_order amd_control amd_info amd_valid amd_preprocess
  12. CONFIG = ../SuiteSparse_config/SuiteSparse_config.h
  13. INC = include/amd.h include/amd_internal.h $(CONFIG)
  14. #-------------------------------------------------------------------------------
  15. # object files for each version
  16. #-------------------------------------------------------------------------------
  17. AMDI = $(addsuffix .o, $(subst amd_,amd_i_,$(AMD)))
  18. AMDL = $(addsuffix .o, $(subst amd_,amd_l_,$(AMD)))
  19. #-------------------------------------------------------------------------------
  20. # compile each int and long routine (with no real/complex version)
  21. #-------------------------------------------------------------------------------
  22. amd_global.o: src/amd_global.c $(INC)
  23. $(C) -c $< -o $@
  24. amd_i_%.o: src/amd_%.c $(INC)
  25. $(C) -DDINT -c $< -o $@
  26. amd_l_%.o: src/amd_%.c $(INC)
  27. $(C) -DDLONG -c $< -o $@
  28. #-------------------------------------------------------------------------------
  29. # Create the libamd.a library (C versions only)
  30. #-------------------------------------------------------------------------------
  31. libamd.a: amd_global.o $(AMDI) $(AMDL)
  32. $(ARCHIVE) libamd.a $^
  33. - $(RANLIB) libamd.a
  34. #-------------------------------------------------------------------------------
  35. # Remove all but the files in the original distribution
  36. #-------------------------------------------------------------------------------
  37. clean:
  38. - $(RM) $(CLEAN)
  39. purge:
  40. - $(RM) libamd.a libamdf77.a