Sync to Wine-0_9_5:
[reactos.git] / rosapps / mc / Makefile.PC
1 # Makefile.PC
2 #
3 # This is the Makefile for Midnight Commander under OS/2 and Windows NT
4 #
5 # Written by Dan Nicolaescu
6 # 970423 hacked by Juan f. Grigera
7 # 970525 hacked again by jfg to add internal editor
8 # 971127 hacked by Pavel Roskin to make it work with mc-4.1.11
9 # 980206 hacked by Pavel Roskin to make it work with GNU make
10 # 980329 changed by Pavel Roskin to make it common for OS/2 and NT
11 #
12 # Supported Compilers:
13 #
14 # For Windows NT:
15 # Makefile.VC4: Microsoft Visual C++ 4.0 and above
16 # Makefile.BC5: Borland C++ 5.x
17 # Makefile.MIN: MinGW
18 # Makefile.RSX: RSX
19 # For OS/2:
20 # Makefile.EMX: EMX/GCC
21 # Makefile.BC2: Borland C++ 2.x
22 # Makefile.IBM: IBM CSet or Visual Age C++
23 # ...
24
25 # ---- Directories
26 MC_PC_DIR=./pc
27 MC_SRC_DIR=./src
28 VFS_DIR=./vfs
29 MCEDIT_SRC_DIR=./edit
30 MCEDIT_OBJS_DIR=$(OBJS_DIR)/edit
31 SLANG_SRC_DIR=./slang
32 SLANG_OBJS_DIR=$(OBJS_DIR)/slang
33 MC_EXE=$(OBJS_DIR)/mc.exe
34
35 # --- Midnight Defines
36 COMMON_DEFINES=-DMC_$(TARGET_OS) $(SPECIFIC_DEFINES)
37 MC_DEFINES=$(COMMON_DEFINES) -DHAVE_CONFIG_H
38 MC_INCLUDES=-I$(MC_PC_DIR) -I$(SLANG_SRC_DIR)
39 SLANG_DEFINES=$(COMMON_DEFINES)
40 SLANG_INCLUDES=-I$(MC_PC_DIR) -I$(SLANG_SRC_DIR)
41 MCEDIT_DEFINES=$(COMMON_DEFINES) -DHAVE_CONFIG_H
42 MCEDIT_INCLUDES=-I$(MC_PC_DIR) -I$(SLANG_SRC_DIR)
43
44 CFLAGS=$(SPECIFIC_MC_CFLAGS) $(MC_INCLUDES) $(MC_DEFINES) -c
45 SLANG_CFLAGS=$(SPECIFIC_SLANG_CFLAGS) $(SLANG_INCLUDES) $(SLANG_DEFINES) -c
46 MCEDIT_CFLAGS=$(SPECIFIC_MCEDIT_CFLAGS) $(MCEDIT_INCLUDES) $(MCEDIT_DEFINES) -c
47
48
49 all: object-dirs mc
50 object-dirs: $(OBJS_DIR) $(SLANG_OBJS_DIR) $(MCEDIT_OBJS_DIR)
51
52 mc: $(MC_EXE)
53
54 clean:
55 "../../reactos/tools/rdel" slang/*.o
56 "../../reactos/tools/rdel" edit/*.o
57 "../../reactos/tools/rdel" src/*.o
58 "../../reactos/tools/rdel" pc/*.o
59 "../../reactos/tools/rdel" release/*.o
60
61 $(OBJS_DIR):
62 mkdir "$@"
63
64 $(SLANG_OBJS_DIR):
65 mkdir "$@"
66
67 $(MCEDIT_OBJS_DIR):
68 mkdir "$@"
69
70 $(OBJS_DIR)/%.$(OBJ_SUFFIX): $(MC_PC_DIR)/%.c
71 $(CC) $(CFLAGS) $(OBJ_PLACE)$@ $<
72
73 $(OBJS_DIR)/%.$(OBJ_SUFFIX): $(MC_SRC_DIR)/%.c
74 $(CC) $(CFLAGS) $(OBJ_PLACE)$@ $<
75
76 $(SLANG_OBJS_DIR)/%.$(OBJ_SUFFIX): $(SLANG_SRC_DIR)/%.c
77 $(CC) $(SLANG_CFLAGS) $(OBJ_PLACE)$@ $<
78
79 $(MCEDIT_OBJS_DIR)/%.$(OBJ_SUFFIX): $(MCEDIT_SRC_DIR)/%.c
80 $(CC) $(MCEDIT_CFLAGS) $(OBJ_PLACE)$@ $<
81
82 MC_SRCS= \
83 terms.c \
84 user.c \
85 file.c \
86 listmode.c \
87 cmd.c \
88 command.c \
89 help.c \
90 menu.c \
91 view.c \
92 dir.c \
93 info.c \
94 widget.c \
95 option.c \
96 dlg.c \
97 panelize.c \
98 profile.c \
99 util.c \
100 dialog.c \
101 ext.c \
102 color.c \
103 layout.c \
104 setup.c \
105 regex.c \
106 hotlist.c \
107 tree.c \
108 win.c \
109 complete.c \
110 find.c \
111 wtools.c \
112 boxes.c \
113 background.c \
114 main.c \
115 popt.c \
116 text.c \
117 screen.c
118
119 PC_SRCS= \
120 slint_pc.c \
121 chmod.c \
122 drive.c
123
124 NT_SRCS= \
125 cons_nt.c \
126 dirent_nt.c \
127 key_nt.c \
128 util_win32.c \
129 util_winnt.c \
130 util_nt.c
131
132 OS2_SRCS= \
133 cons_os2.c \
134 dirent_os2.c \
135 key_os2.c \
136 util_os2.c
137
138 SLANG_NT=slw32tty.c
139 SLANG_OS2=slos2tty.c
140
141 SLANG_SRCS= \
142 slerr.c \
143 slgetkey.c \
144 slsmg.c \
145 slvideo.c \
146 $(SLANG_$(TARGET_OS))
147
148 MCEDIT_SRCS= \
149 edit.c \
150 editcmd.c \
151 editdraw.c \
152 editmenu.c \
153 editoptions.c \
154 editwidget.c \
155 syntax.c \
156 wordproc.c
157
158 SRCS=$(MC_SRCS) $(PC_SRCS) $($(TARGET_OS)_SRCS) $(EXTRA_MC_SRCS)
159
160 OBJS=$(addprefix $(OBJS_DIR)/, \
161 $(patsubst %.c,%.$(OBJ_SUFFIX),$(SRCS)))
162 SLANG_OBJS=$(addprefix $(SLANG_OBJS_DIR)/, \
163 $(patsubst %.c,%.$(OBJ_SUFFIX),$(SLANG_SRCS)))
164 MCEDIT_OBJS=$(addprefix $(MCEDIT_OBJS_DIR)/, \
165 $(patsubst %.c,%.$(OBJ_SUFFIX),$(MCEDIT_SRCS)))
166
167 ifdef RSC
168
169 ifndef RES_SUFFIX
170 RES_SUFFIX=res
171 endif # RES_SUFFIX
172
173 MC_RES=$(OBJS_DIR)/mc.$(RES_SUFFIX)
174
175 $(MC_RES): $(MC_PC_DIR)/mc.rc $(MC_PC_DIR)/mc_nt.ico $(MC_PC_DIR)/config.h ../VERSION
176 $(RSC) $(RES_PLACE)$(MC_RES) $(RC_DEFINES) $(MC_PC_DIR)/mc.rc
177
178 else
179 MC_RES=
180 endif # !RSC