You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile.prebuild 1.3 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # This is triggered by Makefile.system and runs before any of the code is built.
  2. export BINARY
  3. export USE_OPENMP
  4. ifdef TARGET_CORE
  5. TARGET_MAKE = Makefile_kernel.conf
  6. TARGET_CONF = config_kernel.h
  7. else
  8. TARGET_MAKE = Makefile.conf
  9. TARGET_CONF = config.h
  10. endif
  11. # CPUIDEMU = ../../cpuid/table.o
  12. ifdef CPUIDEMU
  13. EXFLAGS = -DCPUIDEMU -DVENDOR=99
  14. endif
  15. all: getarch_2nd
  16. ./getarch_2nd 0 >> $(TARGET_MAKE)
  17. ./getarch_2nd 1 >> $(TARGET_CONF)
  18. config.h : c_check f_check getarch
  19. perl ./c_check $(TARGET_MAKE) $(TARGET_CONF) $(CC)
  20. ifneq ($(ONLY_CBLAS), 1)
  21. perl ./f_check $(TARGET_MAKE) $(TARGET_CONF) $(FC)
  22. else
  23. #When we only build CBLAS, we set NOFORTRAN=2
  24. echo "NOFORTRAN=2" >> $(TARGET_MAKE)
  25. echo "NO_FBLAS=1" >> $(TARGET_MAKE)
  26. echo "F_COMPILER=GFORTRAN" >> $(TARGET_MAKE)
  27. echo "BU=_" >> $(TARGET_MAKE)
  28. echo "#define BUNDERSCORE _" >> $(TARGET_CONF)
  29. echo "#define NEEDBUNDERSCORE 1" >> $(TARGET_CONF)
  30. endif
  31. ./getarch 0 >> $(TARGET_MAKE)
  32. ./getarch 1 >> $(TARGET_CONF)
  33. getarch : getarch.c cpuid.S dummy $(CPUIDEMU)
  34. $(HOSTCC) $(CFLAGS) $(EXFLAGS) -o $(@F) getarch.c cpuid.S $(CPUIDEMU)
  35. getarch_2nd : getarch_2nd.c config.h dummy
  36. ifndef TARGET_CORE
  37. $(HOSTCC) -I. $(CFLAGS) -o $(@F) getarch_2nd.c
  38. else
  39. $(HOSTCC) -I. $(CFLAGS) -DBUILD_KERNEL -o $(@F) getarch_2nd.c
  40. endif
  41. dummy: