Makefile revision 0f8553e2af5fc49a510ecfcfc93e66d06713f631
286N/A#
286N/A# CDDL HEADER START
286N/A#
286N/A# The contents of this file are subject to the terms of the
286N/A# Common Development and Distribution License, Version 1.0 only
286N/A# (the "License"). You may not use this file except in compliance
286N/A# with the License.
286N/A#
286N/A# You can obtain a copy of the license at
286N/A# trunk/opends/resource/legal-notices/OpenDS.LICENSE
286N/A# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
286N/A# See the License for the specific language governing permissions
286N/A# and limitations under the License.
286N/A#
286N/A# When distributing Covered Code, include this CDDL HEADER in each
286N/A# file and include the License file at
286N/A# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
286N/A# add the following below this CDDL HEADER, with the fields enclosed
286N/A# by brackets "[]" replaced with your own identifying information:
286N/A# Portions Copyright [yyyy] [name of copyright owner]
286N/A#
286N/A# CDDL HEADER END
286N/A#
286N/A#
286N/A# Copyright 2008 Sun Microsystems, Inc.
286N/A# Portions Copyright 2011 ForgeRock AS
286N/A
286N/A#
286N/A# This is the Makefile than can be used to generate the executables
286N/A# winlauncher.exe and opendj_service.exe that are used by OpenDS in
286N/A# windows.
286N/A#
286N/A# The compilation of winlauncher.exe is straightforward but in the case of
286N/A# opendj_service.exe uses a Message File called EventLogMsg.mc which
286N/A# makes the compilation a little bit more complex.
286N/A# During compilation the first step is to generate EventLogMsg.h and
286N/A# EventLogMsg.res using the rc.exe and mc.exe utilities.
286N/A#
286N/A# EventLogMsg.h contains some references to the message IDs that are sent to
286N/A# the Windows Event Log and is required in order service.c to be compiled.
286N/A# Once the EvenLogMsg.h file is generated we can compile the service.c and
286N/A# common.c and finally we link the service.obj, common.obj and
286N/A# EventLogMsg.res files and we generate the opendj_service.exe executable.
286N/A#
286N/A
286N/ACC=cl
286N/ASERVICE_PROGNAME=opendj_service.exe
286N/ALAUNCHER_ADMINISTRATOR_PROGNAME=launcher_administrator.exe
286N/AWINLAUNCHER_PROGNAME=winlauncher.exe
286N/ALINKER=link -nologo /machine:x86
286N/ALIBS=advapi32.lib
286N/A
286N/ACFLAGS= -D_WINDOWS -nologo -W3 -O2
286N/ARC=rc
286N/AMC=mc
286N/AMT=mt
286N/A
SRCS = common.c winlauncher.c service.c
SERVICE_OBJS = common.obj service.obj
WINLAUNCHER_OBJS = common.obj winlauncher.obj
EVENTLOG_H = EventLogMsg.h
MC_FILE = EventLogMsg.mc
RC_FILE = EventLogMsg.rc
RES_FILE = EventLogMsg.res
SERVICE_MANIFEST_FILE = opendj_service.exe.manifest
LAUNCHER_ADMINISTRATOR_MANIFEST_FILE = launcher_administrator.exe.manifest
.c.obj:
$(CC) $(CFLAGS) -c $< -Fo$@
$(RES_FILE):
$(MC) $(MC_FILE)
$(RC) /fo $(RES_FILE) $(RC_FILE)
all: $(SERVICE_PROGNAME) $(WINLAUNCHER_PROGNAME) $(LAUNCHER_ADMINISTRATOR_PROGNAME)
$(SERVICE_PROGNAME) : $(RES_FILE) $(SERVICE_OBJS)
$(LINKER) /OUT:$(SERVICE_PROGNAME) $(RES_FILE) $(SERVICE_OBJS) $(LIBS)
$(MT) -manifest "$(SERVICE_MANIFEST_FILE)" -outputresource:"$(SERVICE_PROGNAME)";#1
$(WINLAUNCHER_PROGNAME) : $(WINLAUNCHER_OBJS)
$(LINKER) $(WINLAUNCHER_OBJS) /OUT:$(WINLAUNCHER_PROGNAME)
$(LAUNCHER_ADMINISTRATOR_PROGNAME) : $(WINLAUNCHER_OBJS)
$(LINKER) $(WINLAUNCHER_OBJS) /OUT:$(LAUNCHER_ADMINISTRATOR_PROGNAME)
$(MT) -manifest "$(LAUNCHER_ADMINISTRATOR_MANIFEST_FILE)" -outputresource:"$(LAUNCHER_ADMINISTRATOR_PROGNAME)";#1
clean:
del $(SERVICE_OBJS) $(EVENTLOG_H) $(WINLAUNCHER_OBJS) $(RC_FILE) $(RES_FILE) $(SERVICE_PROGNAME) $(WINLAUNCHER_PROGNAME) $(LAUNCHER_ADMINISTRATOR_PROGNAME) core