1#******************************************************************************
2# Copyright (c) 2000, 2009 IBM Corporation and others.
3#
4# This program and the accompanying materials
5# are made available under the terms of the Eclipse Public License 2.0
6# which accompanies this distribution, and is available at
7# https://www.eclipse.org/legal/epl-2.0/
8#
9# SPDX-License-Identifier: EPL-2.0
10#
11# Contributors:
12#     IBM Corporation - initial API and implementation
13#     Kevin Cornell (Rational Software Corporation)
14#*******************************************************************************
15
16# Makefile for creating the eclipse launcher program.
17
18# This makefile expects the following environment variables set:
19#
20# PROGRAM_OUTPUT  - the filename of the output executable
21# PROGRAM_LIBRARY - the filename of the output dll library
22# DEFAULT_OS      - the default value of the "-os" switch
23# DEFAULT_OS_ARCH - the default value of the "-arch" switch
24# DEFAULT_WS      - the default value of the "-ws" switch
25# JAVA_HOME       - the location of the Java for JNI includes
26NODEBUG=1
27!include <ntwin32.mak>
28!include <..\make_version.mak>
29
30PROGRAM_OUTPUT=eclipse.exe
31# Separate filename from extention
32PROGRAM_NAME=$(PROGRAM_OUTPUT:.exe=)
33
34PROGRAM_LIBRARY = eclipse_$(LIB_VERSION).dll
35
36# Define the object modules to be compiled and flags.
37MAIN_OBJS = eclipseMain.obj
38COMMON_OBJS = eclipseConfig.obj eclipseCommon.obj   eclipseWinCommon.obj
39DLL_OBJS	= eclipse.obj  eclipseWin.obj  eclipseUtil.obj  eclipseJNI.obj eclipseShm.obj
40
41LIBS   = kernel32.lib user32.lib comctl32.lib libcmt.lib
42DLL_LIBS = kernel32.lib user32.lib comctl32.lib gdi32.lib Advapi32.lib libcmt.lib version.lib
43LFLAGS = /DYNAMICBASE /NXCOMPAT /HIGHENTROPYVA /NODEFAULTLIB /INCREMENTAL:NO /LARGEADDRESSAWARE /RELEASE /NOLOGO -subsystem:windows,4.0 -entry:wmainCRTStartup
44CONSOLEFLAGS = /DYNAMICBASE /NXCOMPAT /HIGHENTROPYVA /NODEFAULTLIB /INCREMENTAL:NO /LARGEADDRESSAWARE /RELEASE /NOLOGO -subsystem:console,4.0 -entry:wmainCRTStartup
45DLL_LFLAGS = /DYNAMICBASE /NXCOMPAT /HIGHENTROPYVA /NODEFAULTLIB /INCREMENTAL:NO /LARGEADDRESSAWARE /PDB:NONE /RELEASE /NOLOGO -entry:_DllMainCRTStartup@12 -dll /BASE:0x72000000 /DLL
46RES	= $(PROGRAM_NAME).res
47EXEC	= $(PROGRAM_OUTPUT)
48CONSOLE = $(PROGRAM_NAME)c.exe
49DLL    = $(PROGRAM_LIBRARY)
50DEBUG  = #$(cdebug)
51wcflags = -DUNICODE -I.. -DDEFAULT_OS="\"$(DEFAULT_OS)\"" \
52	-DDEFAULT_OS_ARCH="\"$(DEFAULT_OS_ARCH)\"" \
53	-DDEFAULT_WS="\"$(DEFAULT_WS)\"" \
54	-I$(JAVA_HOME)\include -I$(JAVA_HOME)\include\win32 \
55	$(cflags)
56
57all: $(EXEC) $(DLL) $(CONSOLE)
58
59eclipseMain.obj: ../eclipseUnicode.h ../eclipseCommon.h ../eclipseMain.c
60	$(cc) $(DEBUG) $(wcflags) $(cvarsmt) /Fo$*.obj ../eclipseMain.c
61
62eclipseCommon.obj: ../eclipseCommon.h ../eclipseUnicode.h ../eclipseCommon.c
63	$(cc) $(DEBUG) $(wcflags) $(cvarsmt) /Fo$*.obj ../eclipseCommon.c
64
65eclipse.obj: ../eclipseOS.h ../eclipseUnicode.h ../eclipse.c
66    $(cc) $(DEBUG) $(wcflags) $(cvarsmt) /Fo$*.obj ../eclipse.c
67
68eclipseUtil.obj: ../eclipseUtil.h ../eclipseUnicode.h ../eclipseUtil.c
69    $(cc) $(DEBUG) $(wcflags) $(cvarsmt) /Fo$*.obj ../eclipseUtil.c
70
71eclipseConfig.obj: ../eclipseConfig.h ../eclipseUnicode.h ../eclipseConfig.c
72    $(cc) $(DEBUG) $(wcflags) $(cvarsmt) /Fo$*.obj ../eclipseConfig.c
73
74eclipseWin.obj: ../eclipseOS.h ../eclipseUnicode.h eclipseWin.c
75    $(cc) $(DEBUG) $(wcflags) $(cvarsmt) /Fo$*.obj eclipseWin.c
76
77eclipseWinCommon.obj: ../eclipseCommon.h eclipseWinCommon.c
78    $(cc) $(DEBUG) $(wcflags) $(cvarsmt) /Fo$*.obj eclipseWinCommon.c
79
80eclipseJNI.obj: ../eclipseCommon.h ../eclipseOS.h ../eclipseJNI.c
81	$(CC) $(DEBUG) $(wcflags) $(cvarsmt) /Fo$*.obj ../eclipseJNI.c
82
83eclipseShm.obj: ../eclipseShm.h ../eclipseUnicode.h ../eclipseShm.c
84	$(CC) $(DEBUG) $(wcflags) $(cvarsmt) /Fo$*.obj ../eclipseShm.c
85
86$(EXEC): $(MAIN_OBJS) $(COMMON_OBJS) $(RES)
87    $(link) $(LFLAGS) -out:$(PROGRAM_OUTPUT) $(MAIN_OBJS) $(COMMON_OBJS) $(RES) $(LIBS)
88
89#the console version needs a flag set, should look for a better way to do this
90$(CONSOLE): $(MAIN_OBJS) $(COMMON_OBJS)
91	del -f eclipseConfig.obj aeclipseConfig.obj
92	$(cc) $(DEBUG) $(wcflags) $(cvarsmt) -D_WIN32_CONSOLE /FoeclipseConfig.obj ../eclipseConfig.c
93    $(link) $(CONSOLEFLAGS) -out:$(CONSOLE) $(MAIN_OBJS) $(COMMON_OBJS) $(LIBS)
94
95$(DLL): $(DLL_OBJS) $(COMMON_OBJS)
96    $(link) $(DLL_LFLAGS) -out:$(PROGRAM_LIBRARY) $(DLL_OBJS) $(COMMON_OBJS) $(DLL_LIBS)
97
98$(RES): $(PROGRAM_NAME).rc
99    $(rc) -r -fo $(RES) eclipse.rc
100
101install: all
102	copy $(EXEC) $(OUTPUT_DIR)
103	del -f $(EXEC) $(MAIN_OBJS) $(DLL_OBJS) $(COMMON_OBJS) $(RES)
104
105clean:
106	del $(EXEC) $(DLL) $(MAIN_OBJS) $(DLL_OBJS) $(COMMON_OBJS) $(RES)
107