3 # This is the Makefile for Midnight Commander under OS/2 and Windows NT
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
12 # Supported Compilers:
15 # Makefile.VC4: Microsoft Visual C++ 4.0 and above
16 # Makefile.BC5: Borland C++ 5.x
20 # Makefile.EMX: EMX/GCC
21 # Makefile.BC2: Borland C++ 2.x
22 # Makefile.IBM: IBM CSet or Visual Age C++
29 MCEDIT_SRC_DIR=../edit
30 MCGTKEDIT_SRC_DIR=../edit
31 MCEDIT_OBJS_DIR=$(OBJS_DIR)/edit
32 SLANG_SRC_DIR=../slang
33 SLANG_OBJS_DIR=$(OBJS_DIR)/slang
34 MC_EXE=$(OBJS_DIR)/mc.exe
36 # --- Midnight Defines
37 COMMON_DEFINES=-DMC_$(TARGET_OS) $(SPECIFIC_DEFINES)
38 MC_DEFINES=$(COMMON_DEFINES) -DHAVE_CONFIG_H
39 MC_INCLUDES=-I$(MC_PC_DIR) -I$(SLANG_SRC_DIR)
40 SLANG_DEFINES=$(COMMON_DEFINES)
41 SLANG_INCLUDES=-I$(MC_PC_DIR) -I$(SLANG_SRC_DIR)
42 MCEDIT_DEFINES=$(COMMON_DEFINES) -DHAVE_CONFIG_H
43 MCEDIT_INCLUDES=-I$(MC_PC_DIR) -I$(SLANG_SRC_DIR)
45 CFLAGS=$(SPECIFIC_MC_CFLAGS) $(MC_INCLUDES) $(MC_DEFINES) -c
46 SLANG_CFLAGS=$(SPECIFIC_SLANG_CFLAGS) $(SLANG_INCLUDES) $(SLANG_DEFINES) -c
47 MCEDIT_CFLAGS=$(SPECIFIC_MCEDIT_CFLAGS) $(MCEDIT_INCLUDES) $(MCEDIT_DEFINES) -c
51 object-dirs: $(OBJS_DIR) $(SLANG_OBJS_DIR) $(MCEDIT_OBJS_DIR)
56 deltree -y "$(SLANG_OBJS_DIR)"
57 deltree -y "$(MCEDIT_OBJS_DIR)"
58 deltree -y "$(OBJS_DIR)"
69 $(OBJS_DIR)/%.$(OBJ_SUFFIX): $(MC_PC_DIR)/%.c
70 $(CC) $(CFLAGS) $(OBJ_PLACE)$@ $<
72 $(OBJS_DIR)/%.$(OBJ_SUFFIX): $(MC_SRC_DIR)/%.c
73 $(CC) $(CFLAGS) $(OBJ_PLACE)$@ $<
75 $(SLANG_OBJS_DIR)/%.$(OBJ_SUFFIX): $(SLANG_SRC_DIR)/%.c
76 $(CC) $(SLANG_CFLAGS) $(OBJ_PLACE)$@ $<
78 $(MCEDIT_OBJS_DIR)/%.$(OBJ_SUFFIX): $(MCEDIT_SRC_DIR)/%.c
79 $(CC) $(MCEDIT_CFLAGS) $(OBJ_PLACE)$@ $<
81 $(MCEDIT_OBJS_DIR)/%.$(OBJ_SUFFIX): $(MCGTKEDIT_SRC_DIR)/%.c
82 $(CC) -I$(MCGTKEDIT_SRC_DIR) -I$(MCEDIT_SRC_DIR) -I$(MCEDIT_SRC_DIR)/.. $(MCEDIT_CFLAGS) $(OBJ_PLACE)$@ $<
151 $(SLANG_$(TARGET_OS))
163 SRCS=$(MC_SRCS) $(PC_SRCS) $($(TARGET_OS)_SRCS) $(EXTRA_MC_SRCS)
165 OBJS=$(addprefix $(OBJS_DIR)/, \
166 $(patsubst %.c,%.$(OBJ_SUFFIX),$(SRCS)))
167 SLANG_OBJS=$(addprefix $(SLANG_OBJS_DIR)/, \
168 $(patsubst %.c,%.$(OBJ_SUFFIX),$(SLANG_SRCS)))
169 MCEDIT_OBJS=$(addprefix $(MCEDIT_OBJS_DIR)/, \
170 $(patsubst %.c,%.$(OBJ_SUFFIX),$(MCEDIT_SRCS)))
178 MC_RES=$(OBJS_DIR)/mc.$(RES_SUFFIX)
180 $(MC_RES): $(MC_PC_DIR)/mc.rc $(MC_PC_DIR)/mc_nt.ico $(MC_PC_DIR)/config.h VERSION
181 $(RSC) $(RES_PLACE)$(MC_RES) $(RC_DEFINES) $(MC_PC_DIR)/mc.rc
187 VERSION: ../configure.in
188 sed -n -e 's/^AM_INIT_AUTOMAKE([^,]*,[ []*\([0-9A-Za-z.-_]*\).*$$/#define VERSION "\1"/p' $< > $@