2021-07-23 22:52:08 +02:00
|
|
|
CC = kos32-gcc
|
|
|
|
LD = kos32-ld
|
|
|
|
KPACK = kpack
|
|
|
|
|
|
|
|
DDK_TOPDIR = ../../ddk
|
|
|
|
DRV_INCLUDES = ../../include
|
|
|
|
|
2023-12-28 15:06:06 +01:00
|
|
|
INCLUDES= -I$(DRV_INCLUDES) \
|
|
|
|
-I$(DRV_INCLUDES)/asm \
|
|
|
|
-I$(DRV_INCLUDES)/uapi \
|
|
|
|
-I$(DRV_INCLUDES)/drm
|
2021-07-23 22:52:08 +02:00
|
|
|
|
|
|
|
NAME=k10temp
|
|
|
|
|
|
|
|
DEFINES = -DKOLIBRI -D__KERNEL__ -DCONFIG_X86_32 -DCONFIG_DMI -DCONFIG_TINY_RCU
|
|
|
|
DEFINES+= -DCONFIG_X86_L1_CACHE_SHIFT=6 -DCONFIG_ARCH_HAS_CACHE_LINE_SIZE
|
|
|
|
DEFINES+= -DCONFIG_PRINTK -DCONFIG_PCI -DCONFIG_PCI -DCONFIG_AMD_NB -DKBUILD_MODNAME=\"k10temp\"
|
|
|
|
|
2021-08-01 20:55:58 +02:00
|
|
|
CFLAGS= -c -Os -march=i686 -fno-ident -msse2 -fomit-frame-pointer -fno-builtin-printf
|
2021-07-23 22:52:08 +02:00
|
|
|
CFLAGS+= -mno-stack-arg-probe -mpreferred-stack-boundary=2 -mincoming-stack-boundary=2 -mno-ms-bitfields
|
|
|
|
|
|
|
|
LIBPATH = -L $(DDK_TOPDIR)
|
|
|
|
LIBPATH+= -L ../../../contrib/sdk/lib -L
|
|
|
|
|
2023-12-28 15:06:06 +01:00
|
|
|
LIBS:= -lddk -lcore -lgcc
|
2021-07-23 22:52:08 +02:00
|
|
|
|
|
|
|
LDFLAGS = -nostdlib -shared -s --major-os-version 0 --minor-os-version 7 \
|
2023-12-28 15:06:06 +01:00
|
|
|
--major-subsystem-version 0 --minor-subsystem-version 5 --subsystem native \
|
|
|
|
--image-base 0 --file-alignment 512 --section-alignment 4096
|
2021-07-23 22:52:08 +02:00
|
|
|
|
2023-12-28 15:06:06 +01:00
|
|
|
OBJS = k10temp.o ../pci.o ../amd_nb.o ../cpu_detect.o
|
2021-07-23 22:52:08 +02:00
|
|
|
|
2021-08-01 20:55:58 +02:00
|
|
|
all: $(OBJS) $(NAME).sys
|
2021-07-23 22:52:08 +02:00
|
|
|
|
2021-08-01 20:55:58 +02:00
|
|
|
$(NAME).sys: $(OBJS)
|
2021-07-23 22:52:08 +02:00
|
|
|
$(LD) $(LIBPATH) $(LDFLAGS) -T ../drv.lds $(OBJS) -o $@ $(NAME_OBJS) $(LIBS)
|
2021-08-01 20:55:58 +02:00
|
|
|
$(KPACK) $(NAME).sys
|
2021-07-23 22:52:08 +02:00
|
|
|
|
|
|
|
%.o : %.c Makefile
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $<
|
|
|
|
|
|
|
|
clean:
|
2021-08-01 20:55:58 +02:00
|
|
|
rm -f $(OBJS) $(NAME).sys
|