Added master makefile with clean/dist/floppy targets.
[reactos.git] / rosapps / rules.mak
1 #
2 # Select your host
3 #
4 #HOST = mingw32-linux
5 HOST = mingw32-windows
6
7
8 #
9 # Important
10 #
11 .EXPORT_ALL_VARIABLES:
12
13 ifeq ($(HOST),mingw32-linux)
14 TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
15 endif
16
17 #
18 # Choose various options
19 #
20 ifeq ($(HOST),mingw32-linux)
21 PREFIX = i586-mingw32-
22 EXE_POSTFIX =
23 CP = cp
24 DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
25 FLOPPY_DIR = A/
26 # DIST_DIR should be relative from the top of the tree
27 DIST_DIR = dist
28 endif
29
30 ifeq ($(HOST),mingw32-windows)
31 PREFIX =
32 EXE_POSTFIX = .exe
33 CP = copy
34 DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
35 RM = del
36 DOSCLI = yes
37 FLOPPY_DIR = A:
38 # DIST_DIR should be relative from the top of the tree
39 DIST_DIR = dist
40 endif
41
42 #
43 # Create variables for all the compiler tools
44 #
45 ifeq ($(WITH_DEBUGGING),yes)
46 DEBUGGING_CFLAGS = -g
47 else
48 DEBUGGING_CFLAGS =
49 endif
50
51 ifeq ($(WARNINGS_ARE_ERRORS),yes)
52 EXTRA_CFLAGS = -Werror
53 endif
54
55 DEFINES = -DDBG
56
57 ifeq ($(WIN32_LEAN_AND_MEAN),yes)
58 LEAN_AND_MEAN_DEFINE = -DWIN32_LEAN_AND_MEAN
59 else
60 LEAN_AND_MEAN_DEFINE =
61 endif
62
63 CC = $(PREFIX)gcc
64 NATIVE_CC = gcc
65 CFLAGS = -O2 -Wall -Wstrict-prototypes -fno-builtin \
66 $(LEAN_AND_MEAN_DEFINE) $(DEFINES) $(DEBUGGING_CFLAGS) \
67 $(EXTRA_CFLAGS)
68 CXXFLAGS = $(CFLAGS)
69 LD = $(PREFIX)ld
70 NM = $(PREFIX)nm
71 OBJCOPY = $(PREFIX)objcopy
72 STRIP = $(PREFIX)strip
73 AS = $(PREFIX)gcc -c -x assembler-with-cpp
74 CPP = $(PREFIX)cpp
75 AR = $(PREFIX)ar
76 RC = $(PREFIX)windres
77
78 %.o: %.c
79 $(CC) $(CFLAGS) -c $< -o $@
80 %.coff: %.rc
81 $(RC) $< $@
82
83
84 RULES_MAK_INCLUDED = 1