0N/A#
2362N/A# CDDL HEADER START
0N/A#
0N/A# The contents of this file are subject to the terms of the
0N/A# Common Development and Distribution License, Version 1.0 only
0N/A# (the "License"). You may not use this file except in compliance
2362N/A# with the License.
0N/A#
2362N/A# You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
0N/A# or http://forgerock.org/license/CDDLv1.0.html.
0N/A# See the License for the specific language governing permissions
0N/A# and limitations under the License.
0N/A#
0N/A# When distributing Covered Code, include this CDDL HEADER in each
0N/A# file and include the License file at legal-notices/CDDLv1_0.txt.
0N/A# If applicable, add the following below this CDDL HEADER, with the
0N/A# fields enclosed by brackets "[]" replaced with your own identifying
0N/A# information:
0N/A# Portions Copyright [yyyy] [name of copyright owner]
0N/A#
2362N/A# CDDL HEADER END
2362N/A#
2362N/A#
0N/A# Copyright 2008 Sun Microsystems, Inc.
0N/A# Portions Copyright 2011 ForgeRock AS
0N/A
0N/A#
0N/A# This is the Makefile than can be used to generate the executables
0N/A# winlauncher.exe and opendj_service.exe that are used by OpenDS in
0N/A# windows.
0N/A#
0N/A# The compilation of winlauncher.exe is straightforward but in the case of
0N/A# opendj_service.exe uses a Message File called EventLogMsg.mc which
0N/A# makes the compilation a little bit more complex.
0N/A# During compilation the first step is to generate EventLogMsg.h and
0N/A# EventLogMsg.res using the rc.exe and mc.exe utilities.
0N/A#
0N/A# EventLogMsg.h contains some references to the message IDs that are sent to
0N/A# the Windows Event Log and is required in order service.c to be compiled.
2157N/A# Once the EvenLogMsg.h file is generated we can compile the service.c and
2157N/A# common.c and finally we link the service.obj, common.obj and
2157N/A# EventLogMsg.res files and we generate the opendj_service.exe executable.
2157N/A#
0N/A
0N/ACC=cl
0N/ASERVICE_PROGNAME=opendj_service.exe
0N/ALAUNCHER_ADMINISTRATOR_PROGNAME=launcher_administrator.exe
0N/AWINLAUNCHER_PROGNAME=winlauncher.exe
0N/ALINKER=link -nologo /machine:x86
2157N/ALIBS=advapi32.lib
2157N/A
0N/ACFLAGS= -D_WINDOWS -nologo -W3 -O2
0N/ARC=rc
0N/AMC=mc
0N/AMT=mt
0N/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