Full memory management support (memory.c & memory.h & mem.S)
[reactos.git] / reactos / rules.mak
index 0684fcf..02ca0a3 100644 (file)
@@ -3,6 +3,11 @@
 #
 .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
@@ -12,90 +17,72 @@ endif
 #
 ifeq ($(HOST),mingw32-linux)
 NASM_FORMAT = win32
-PREFIX = i586-mingw32-
-EXE_POSTFIX = 
-EXE_PREFIX = ./
+PREFIX = /usr/mingw32-cvs-000216/bin/mingw32-pc-
+#PREFIX = i586-mingw32-
+#PREFIX = /usr/mingw32-cvs-000207/bin/mingw32-cvs-000207-
+EXE_POSTFIX := 
+EXE_PREFIX := ./
 #CP = cp
 CP = $(PATH_TO_TOP)/rcopy
 DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
 NASM_CMD = nasm
-KM_SPECS = $(TOPDIR)/specs
+#KM_SPECS = $(TOPDIR)/specs
 FLOPPY_DIR = /a
 # DIST_DIR should be relative from the top of the tree
 DIST_DIR = dist
+#DOT := \\.
+#DSEP := /
+#ENABLE_DEPENDENCY_TRACKING := 1
 endif
 
 ifeq ($(HOST),mingw32-windows)
 NASM_FORMAT = win32
 PREFIX = 
-EXE_POSTFIX = .exe
+EXE_PREFIX := 
+EXE_POSTFIX := .exe
 #CP = copy /B
-CP = rcopy
+CP = $(PATH_TO_TOP)/rcopy
 DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
-NASM_CMD = nasm
+NASM_CMD = nasmw
 RM = del
 RMDIR = rmdir
-KM_SPECS = specs
+#KM_SPECS = specs
 DOSCLI = yes
 FLOPPY_DIR = A:
 # DIST_DIR should be relative from the top of the tree
 DIST_DIR = dist
+#DOT := \.
+#DSEP := \\
+#ENABLE_DEPENDENCY_TRACKING := 1
 endif
 
-#
-# Create variables for all the compiler tools 
-#
-ifeq ($(WITH_DEBUGGING),yes)
-DEBUGGING_CFLAGS = -g
-OPTIMIZATIONS = -O2
-else
-DEBUGGING_CFLAGS =
-OPTIMIZATIONS = -O2
-endif
-
-ifeq ($(WARNINGS_ARE_ERRORS),yes)
-EXTRA_CFLAGS = -Werror
-endif
-
-DEFINES = -DDBG
-
-ifeq ($(WIN32_LEAN_AND_MEAN),yes)
-LEAN_AND_MEAN_DEFINE = -DWIN32_LEAN_AND_MEAN
-else
-LEAN_AND_MEAN_DEFINE = 
-endif 
-
 CC = $(PREFIX)gcc
-NATIVE_CC = gcc
-NATIVE_NM = nm
-CFLAGS = $(BASE_CFLAGS) \
-       -pipe \
-       $(OPTIMIZATIONS) \
-       $(LEAN_AND_MEAN_DEFINE)  \
-       $(DEFINES) -Wall \
-       -Wstrict-prototypes $(DEBUGGING_CFLAGS) \
-       $(EXTRA_CFLAGS)
+CXX = $(PREFIX)g++
+HOST_CC = gcc
+HOST_NM = nm
+CFLAGS := $(CFLAGS) -I$(PATH_TO_TOP)/include -pipe -m386
 CXXFLAGS = $(CFLAGS)
-NFLAGS = -i../../include/ -i../include/ -pinternal/asm.inc -f$(NASM_FORMAT) -d$(NASM_FORMAT)
+NFLAGS = -i$(PATH_TO_TOP)/include/ -f$(NASM_FORMAT) -d$(NASM_FORMAT)
 LD = $(PREFIX)ld
 NM = $(PREFIX)nm
 OBJCOPY = $(PREFIX)objcopy
 STRIP = $(PREFIX)strip
-AS_INCLUDES = -I../include
-AS = $(PREFIX)gcc -c -x assembler-with-cpp -D__ASM__ $(AS_BASEFLAGS) $(AS_INCLUDES)
+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 ../include        \
-       --include-dir ../../include     \
-       --include-dir ../../../include  \
-       --include-dir ../../../../include
+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
@@ -103,7 +90,7 @@ RCINC = \
 
 %.sys: %.o
        $(CC) \
-               -specs=$(PATH_TO_TOP)/services/svc_specs \
+               -nostartfiles -nostdlib -e _DriverEntry@8\
                -mdll \
                -o junk.tmp \
                -Wl,--defsym,_end=end \
@@ -119,17 +106,19 @@ RCINC = \
        - $(RM) base.tmp
        $(CC) \
                --verbose \
+               -Wl,--subsystem,native \
                -Wl,--image-base,0x10000 \
                -Wl,-e,_DriverEntry@8 \
                -Wl,temp.exp \
-               -specs=$(PATH_TO_TOP)/services/svc_specs \
+               -nostartfiles -nostdlib -e _DriverEntry@8 \
                -mdll \
                -o $@.unstripped \
                $^
        - $(RM) temp.exp
+       - $(NM) --numeric-sort $@.unstripped > $@.sym
        $(STRIP) --strip-debug $<
        $(CC) \
-               -specs=$(PATH_TO_TOP)/services/svc_specs \
+               -nostartfiles -nostdlib -e _DriverEntry@8 \
                -mdll \
                -o junk.tmp \
                -Wl,--defsym,_end=end \
@@ -145,10 +134,11 @@ RCINC = \
        - $(RM) base.tmp
        $(CC) \
                --verbose \
+               -Wl,--subsystem,native \
                -Wl,--image-base,0x10000 \
                -Wl,-e,_DriverEntry@8 \
                -Wl,temp.exp \
-               -specs=$(PATH_TO_TOP)/services/svc_specs \
+               -nostartfiles -nostdlib -e _DriverEntry@8 \
                -mdll \
                -o $@ \
                $^