1 # This is triggered by Makefile.system and runs before any of the code is built.
7 TARGET_MAKE = Makefile_kernel.conf
8 TARGET_CONF = config_kernel.h
10 TARGET_MAKE = Makefile.conf
11 TARGET_CONF = config.h
14 # CPUIDEMU = ../../cpuid/table.o
17 EXFLAGS = -DCPUIDEMU -DVENDOR=99
20 ifeq ($(TARGET), P5600)
21 TARGET_FLAGS = -mips32r5
24 ifeq ($(TARGET), I6400)
25 TARGET_FLAGS = -mips64r6
28 ifeq ($(TARGET), P6600)
29 TARGET_FLAGS = -mips64r6
32 ifeq ($(TARGET), I6500)
33 TARGET_FLAGS = -mips64r6
37 ./getarch_2nd 0 >> $(TARGET_MAKE)
38 ./getarch_2nd 1 >> $(TARGET_CONF)
40 config.h : c_check f_check getarch
41 perl ./c_check $(TARGET_MAKE) $(TARGET_CONF) $(CC) $(TARGET_FLAGS)
42 ifneq ($(ONLY_CBLAS), 1)
43 perl ./f_check $(TARGET_MAKE) $(TARGET_CONF) $(FC) $(TARGET_FLAGS)
45 #When we only build CBLAS, we set NOFORTRAN=2
46 echo "NOFORTRAN=2" >> $(TARGET_MAKE)
47 echo "NO_FBLAS=1" >> $(TARGET_MAKE)
48 echo "F_COMPILER=GFORTRAN" >> $(TARGET_MAKE)
49 echo "BU=_" >> $(TARGET_MAKE)
50 echo "#define BUNDERSCORE _" >> $(TARGET_CONF)
51 echo "#define NEEDBUNDERSCORE 1" >> $(TARGET_CONF)
53 ./getarch 0 >> $(TARGET_MAKE)
54 ./getarch 1 >> $(TARGET_CONF)
57 getarch : getarch.c cpuid.S dummy $(CPUIDEMU)
58 $(HOSTCC) $(CFLAGS) $(EXFLAGS) -o $(@F) getarch.c cpuid.S $(CPUIDEMU)
60 getarch_2nd : getarch_2nd.c config.h dummy
62 $(HOSTCC) -I. $(CFLAGS) -o $(@F) getarch_2nd.c
64 $(HOSTCC) -I. $(CFLAGS) -DBUILD_KERNEL -o $(@F) getarch_2nd.c