mirror of https://github.com/FDOS/kernel.git
Add cross-compile capability on Windows with OpenWatcom and mingw32-make
(Remove dependance on 16bit DOS executables when building)
This commit is contained in:
parent
8ca06cf20a
commit
0c6be32a7a
|
@ -100,9 +100,14 @@ static unsigned short __inline getSS(void)
|
|||
asm mov ax, ss;
|
||||
}
|
||||
|
||||
#elif defined(__WATCOMC__) && defined(BUILD_UTILS)
|
||||
/* workaround for building some utils with OpenWatcom (owcc) */
|
||||
#define MC68K
|
||||
#elif defined(__WATCOMC__) /* don't know a better way */
|
||||
|
||||
#if defined(_M_I86)
|
||||
#define I86
|
||||
#endif
|
||||
#define __int__(intno) asm int intno;
|
||||
void disable(void);
|
||||
#pragma aux disable = "cli" modify exact [];
|
||||
|
@ -170,10 +175,12 @@ We might even deal with a pre-ANSI compiler. This will certainly not compile.
|
|||
typedef __SIZE_TYPE__ size_t;
|
||||
#else
|
||||
#define CONST
|
||||
#if !(defined(_SIZE_T) || defined(_SIZE_T_DEFINED) || defined(__SIZE_T_DEFINED))
|
||||
typedef unsigned size_t;
|
||||
#endif
|
||||
#endif
|
||||
#ifdef I86
|
||||
#endif
|
||||
#if defined(I86) && !defined(MC68K)
|
||||
#define VOID void
|
||||
#define FAR far /* segment architecture */
|
||||
#define NEAR near /* " " */
|
||||
|
|
25
makefile
25
makefile
|
@ -1,10 +1,14 @@
|
|||
# What you WANT on DOS is:
|
||||
# EDIT CONFIG.B, COPY CONFIG.B to CONFIG.BAT, RUN BUILD.BAT
|
||||
# On Linux, use config.mak, and "make all", "make clean", or "make clobber"
|
||||
# On Windows, use config.mak, and
|
||||
# "mingw32-make all", "mingw32-make clean", or "mingw32-make clobber"
|
||||
|
||||
default:
|
||||
@echo On DOS, please type build, clean, or clobber.
|
||||
@echo On Linux, please type make all, make clean, or make clobber.
|
||||
@echo On Windows, please type mingw32-make all, mingw32-make clean, or
|
||||
@echo mingw32-make clobber.
|
||||
|
||||
build:
|
||||
build
|
||||
|
@ -60,14 +64,27 @@ zip: zip_src zipfat16 zipfat32
|
|||
#Linux part
|
||||
#defaults: override using config.mak
|
||||
export
|
||||
COMPILER=owlinux
|
||||
|
||||
XCPU=86
|
||||
XFAT=32
|
||||
ifeq ($(OS),Windows_NT)
|
||||
BUILDENV ?= windows
|
||||
else
|
||||
BUILDENV ?= linux
|
||||
endif
|
||||
|
||||
ifeq ($(BUILDENV),windows)
|
||||
COMPILER=owwin
|
||||
TEST_F=type >nul 2>nul
|
||||
else
|
||||
COMPILER=owlinux
|
||||
TEST_F=test -f
|
||||
ifndef WATCOM
|
||||
WATCOM=$(HOME)/watcom
|
||||
PATH:=$(WATCOM)/binl:$(PATH)
|
||||
endif
|
||||
endif
|
||||
|
||||
XCPU=86
|
||||
XFAT=32
|
||||
XUPX=upx --8086 --best
|
||||
XNASM=nasm
|
||||
MAKE=wmake -ms -h
|
||||
|
@ -81,7 +98,7 @@ endif
|
|||
|
||||
all:
|
||||
cd utils && $(MAKE) production
|
||||
cd lib && ( test -f libm.lib || touch libm.lib )
|
||||
cd lib && ( $(TEST_F) libm.lib || wtouch libm.lib )
|
||||
cd drivers && $(MAKE) production
|
||||
cd boot && $(MAKE) production
|
||||
cd sys && $(MAKE) production
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
#
|
||||
# WATCOM.MAK - kernel compiler options for Open Watcom on Windows (cross-compile)
|
||||
#
|
||||
|
||||
# Get definitions from watcom.mak, then override
|
||||
include "../mkfiles/watcom.mak"
|
||||
|
||||
DIRSEP=\
|
||||
|
||||
INCLUDEPATH=$(COMPILERPATH)$(DIRSEP)h
|
||||
#RM=del 2>nul
|
||||
#CP=copy
|
||||
#ECHOTO=echo>>
|
||||
#INITPATCH=@echo > nul
|
||||
CLDEF=1
|
||||
CLT=owcc -DDOSC_TIME_H -DBUILD_UTILS -I../hdr -o $@
|
||||
CLC=$(CLT)
|
||||
CFLAGST=-fo=.obj $(CFLAGST)
|
||||
ALLCFLAGS=-fo=.obj $(ALLCFLAGS)
|
||||
NASMFLAGS=-Dowlinux $(NASMFLAGS)
|
||||
XLINK=$(XLINK) debug all op symfile format dos option map,statics,verbose F { $(OBJS) } L ..$(DIRSEP)lib$(DIRSEP)device.lib N kernel.exe $#
|
34
sys/makefile
34
sys/makefile
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# makefile for bin2c.com and sys.com
|
||||
# makefile for bin2c.exe and sys.com
|
||||
#
|
||||
# $Id: makefile 1482 2009-07-11 16:59:43Z perditionc $
|
||||
#
|
||||
|
@ -18,31 +18,31 @@ SYS_EXE_dependencies = \
|
|||
talloc.obj
|
||||
|
||||
# *Explicit Rules*
|
||||
production: bin2c.com ../bin/sys.com
|
||||
production: bin2c.exe ../bin/sys.com
|
||||
|
||||
bin2c.com: bin2c.c
|
||||
$(CLT) bin2c.c
|
||||
bin2c.exe: bin2c.c
|
||||
$(CLC) bin2c.c
|
||||
|
||||
../bin/sys.com: sys.com
|
||||
$(CP) sys.com ..$(DIRSEP)bin
|
||||
|
||||
fat12com.h: ../boot/fat12com.bin bin2c.com
|
||||
.$(DIRSEP)bin2c.com ../boot/fat12com.bin fat12com.h fat12com
|
||||
fat12com.h: ../boot/fat12com.bin bin2c.exe
|
||||
.$(DIRSEP)bin2c.exe ../boot/fat12com.bin fat12com.h fat12com
|
||||
|
||||
fat16com.h: ../boot/fat16com.bin bin2c.com
|
||||
.$(DIRSEP)bin2c.com ../boot/fat16com.bin fat16com.h fat16com
|
||||
fat16com.h: ../boot/fat16com.bin bin2c.exe
|
||||
.$(DIRSEP)bin2c.exe ../boot/fat16com.bin fat16com.h fat16com
|
||||
|
||||
fat32chs.h: ../boot/fat32chs.bin bin2c.com
|
||||
.$(DIRSEP)bin2c.com ../boot/fat32chs.bin fat32chs.h fat32chs
|
||||
fat32chs.h: ../boot/fat32chs.bin bin2c.exe
|
||||
.$(DIRSEP)bin2c.exe ../boot/fat32chs.bin fat32chs.h fat32chs
|
||||
|
||||
fat32lba.h: ../boot/fat32lba.bin bin2c.com
|
||||
.$(DIRSEP)bin2c.com ../boot/fat32lba.bin fat32lba.h fat32lba
|
||||
fat32lba.h: ../boot/fat32lba.bin bin2c.exe
|
||||
.$(DIRSEP)bin2c.exe ../boot/fat32lba.bin fat32lba.h fat32lba
|
||||
|
||||
oemfat12.h: ../boot/oemfat12.bin bin2c.com
|
||||
.$(DIRSEP)bin2c.com ../boot/oemfat12.bin oemfat12.h oemfat12
|
||||
oemfat12.h: ../boot/oemfat12.bin bin2c.exe
|
||||
.$(DIRSEP)bin2c.exe ../boot/oemfat12.bin oemfat12.h oemfat12
|
||||
|
||||
oemfat16.h: ../boot/oemfat16.bin bin2c.com
|
||||
.$(DIRSEP)bin2c.com ../boot/oemfat16.bin oemfat16.h oemfat16
|
||||
oemfat16.h: ../boot/oemfat16.bin bin2c.exe
|
||||
.$(DIRSEP)bin2c.exe ../boot/oemfat16.bin oemfat16.h oemfat16
|
||||
|
||||
prf.obj: ../kernel/prf.c
|
||||
$(CC) $(CFLAGS) ..$(DIRSEP)kernel$(DIRSEP)prf.c
|
||||
|
@ -55,7 +55,7 @@ sys.com: $(SYS_EXE_dependencies)
|
|||
$(CL) $(CFLAGST) $(TINY) $(SYS_EXE_dependencies)
|
||||
|
||||
clobber: clean
|
||||
-$(RM) bin2c.com sys.com fat*.h oemfat*.h
|
||||
-$(RM) bin2c.exe sys.com fat*.h oemfat*.h
|
||||
|
||||
clean:
|
||||
-$(RM) *.obj *.bak *.crf *.xrf *.map *.lst *.las *.cod *.err status.me
|
||||
|
|
Loading…
Reference in New Issue