1 # 2 # This file and its contents are supplied under the terms of the 3 # Common Development and Distribution License ("CDDL"), version 1.0. 4 # You may only use this file in accordance with the terms of version 5 # 1.0 of the CDDL. 6 # 7 # A full copy of the text of the CDDL should have accompanied this 8 # source. A copy of the CDDL is also available via the Internet at 9 # http://www.illumos.org/license/CDDL. 10 # 11 12 # 13 # Copyright 2015 Toomas Soome <tsoome@me.com> 14 # Copyright 2016 RackTop Systems. 15 # 16 17 include $(SRC)/Makefile.master 18 19 PROG= btx 20 SRCS= btx.S 21 OBJS= btx.o 22 23 AS= $(GNU_ROOT)/bin/gas 24 LD= $(GNU_ROOT)/bin/gld 25 CC= $(GCC_ROOT)/bin/gcc 26 27 #.if defined(BOOT_BTX_NOHANG) 28 #BOOT_BTX_FLAGS=0x1 29 #.else 30 BOOT_BTX_FLAGS=0x0 31 #.endif 32 33 CFLAGS = -DBTX_FLAGS=${BOOT_BTX_FLAGS} 34 CFLAGS += -I./../../common 35 CFLAGS += -march=i386 -ffreestanding -mno-mmx -mno-3dnow -mno-sse -mno-sse2 36 CFLAGS += -mno-sse3 -msoft-float -m32 -std=gnu99 37 CFLAGS += -Wa,--divide 38 39 #.if defined(BTX_SERIAL) 40 #BOOT_COMCONSOLE_PORT?= 0x3f8 41 #BOOT_COMCONSOLE_SPEED?= 9600 42 #B2SIOFMT?= 0x3 43 # 44 #CFLAGS+=-DBTX_SERIAL -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ 45 # -DSIOFMT=${B2SIOFMT} -DSIOSPD=${BOOT_COMCONSOLE_SPEED} 46 #.endif 47 48 ORG= 0x9000 49 50 LDFLAGS=-e start -Ttext ${ORG} -N -S --oformat binary 51 52 all: $(PROG) 53 54 install: all 55 56 $(PROG): $(OBJS) 57 $(LD) $(LDFLAGS) -o $@ $(OBJS) 58 59 .S.o: 60 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< 61 62 clobber: clean 63 64 clean: 65 $(RM) $(PROG) $(OBJS)