From c40c9f88c14aaf7b70fa71335db69b2d71f7b1f2 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 3 Dec 2000 20:31:03 +0000 Subject: [PATCH] no message svn path=/trunk/; revision=1447 --- reactos/rules.mak | 144 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 reactos/rules.mak diff --git a/reactos/rules.mak b/reactos/rules.mak new file mode 100644 index 00000000000..2dab3729d8d --- /dev/null +++ b/reactos/rules.mak @@ -0,0 +1,144 @@ +# +# Important +# +.EXPORT_ALL_VARIABLES: + +#HOST = mingw32-windows + +# uncomment if you use bochs and it displays only 30 rows +# BOCHS_30ROWS = yes + +ifeq ($(HOST),mingw32-linux) +TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) +endif + +# +# Choose various options +# +ifeq ($(HOST),mingw32-linux) +NASM_FORMAT = win32 +PREFIX = i586-mingw32- +EXE_POSTFIX = +EXE_PREFIX = ./ +#CP = cp +CP = $(PATH_TO_TOP)/rcopy +DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as +NASM_CMD = nasm +#KM_SPECS = $(TOPDIR)/specs +FLOPPY_DIR = /a +# DIST_DIR should be relative from the top of the tree +DIST_DIR = dist +endif + +ifeq ($(HOST),mingw32-windows) +NASM_FORMAT = win32 +PREFIX = +EXE_POSTFIX = .exe +#CP = copy /B +CP = $(PATH_TO_TOP)/rcopy +DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as +NASM_CMD = nasm +RM = del +RMDIR = rmdir +#KM_SPECS = specs +DOSCLI = yes +FLOPPY_DIR = A: +# DIST_DIR should be relative from the top of the tree +DIST_DIR = dist +endif + +CC = $(PREFIX)gcc +HOST_CC = gcc +HOST_NM = nm +CFLAGS := $(CFLAGS) -I$(PATH_TO_TOP)/include -pipe +CXXFLAGS = $(CFLAGS) +NFLAGS = -i$(PATH_TO_TOP)/include/ -f$(NASM_FORMAT) -d$(NASM_FORMAT) +LD = $(PREFIX)ld +NM = $(PREFIX)nm +OBJCOPY = $(PREFIX)objcopy +STRIP = $(PREFIX)strip +ASFLAGS := $(ASFLAGS) -I$(PATH_TO_TOP)/include -D__ASM__ +AS = $(PREFIX)gcc -c -x assembler-with-cpp +CPP = $(PREFIX)cpp +AR = $(PREFIX)ar +RC = $(PREFIX)windres +RCINC = --include-dir $(PATH_TO_TOP)/include +OBJCOPY = $(PREFIX)objcopy + +%.o: %.cc + $(CC) $(CFLAGS) -c $< -o $@ +%.o: %.c + $(CC) $(CFLAGS) -c $< -o $@ +%.o: %.S + $(AS) $(ASFLAGS) -c $< -o $@ +%.o: %.s + $(AS) $(ASFLAGS) -c $< -o $@ +%.o: %.asm + $(NASM_CMD) $(NFLAGS) $< -o $@ +%.coff: %.rc + $(RC) $(RCINC) $< $@ + +%.sys: %.o + $(CC) \ + -nostartfiles -nostdlib -e _DriverEntry@8\ + -mdll \ + -o junk.tmp \ + -Wl,--defsym,_end=end \ + -Wl,--defsym,_edata=__data_end__ \ + -Wl,--defsym,_etext=etext \ + -Wl,--base-file,base.tmp $^ + - $(RM) junk.tmp + $(DLLTOOL) \ + --dllname $@ \ + --base-file base.tmp \ + --output-exp temp.exp \ + --kill-at + - $(RM) base.tmp + $(CC) \ + --verbose \ + -Wl,--subsystem,native \ + -Wl,--image-base,0x10000 \ + -Wl,-e,_DriverEntry@8 \ + -Wl,temp.exp \ + -nostartfiles -nostdlib -e _DriverEntry@8 \ + -mdll \ + -o $@.unstripped \ + $^ + - $(RM) temp.exp + $(STRIP) --strip-debug $< + $(CC) \ + -nostartfiles -nostdlib -e _DriverEntry@8 \ + -mdll \ + -o junk.tmp \ + -Wl,--defsym,_end=end \ + -Wl,--defsym,_edata=__data_end__ \ + -Wl,--defsym,_etext=etext \ + -Wl,--base-file,base.tmp $^ + - $(RM) junk.tmp + $(DLLTOOL) \ + --dllname $@ \ + --base-file base.tmp \ + --output-exp temp.exp \ + --kill-at + - $(RM) base.tmp + $(CC) \ + --verbose \ + -Wl,--subsystem,native \ + -Wl,--image-base,0x10000 \ + -Wl,-e,_DriverEntry@8 \ + -Wl,temp.exp \ + -nostartfiles -nostdlib -e _DriverEntry@8 \ + -mdll \ + -o $@ \ + $^ + - $(RM) temp.exp + +RULES_MAK_INCLUDED = 1 + + + + + + + +