# -*- Makefile -*-
#----------------------------------------------------------------------------
#       GNU Makefile
#
# @file GNUmakefile.ACE
#
# gnu.mpd,v 1.119 2004/12/16 16:07:21 elliott_c Exp
#
# This file was automatically generated by MPC.  Any changes made directly to
# this file will be lost the next time it is generated.
#
#----------------------------------------------------------------------------
MAKEFILE         = GNUmakefile.ACE
DEPENDENCY_FILE  = .depend.ACE

## LIB may be set to empty later on in this file
LIB_UNCHECKED    = libACE.a
LIB              = $(LIB_UNCHECKED)

## SHLIB may be set to empty later on in this file
SHLIB_UNCHECKED  = libACE.$(SOEXT)
SHLIB            = $(SHLIB_UNCHECKED)

Other = \
  Local_Name_Space \
  Name_Proxy \
  Name_Request_Reply \
  Name_Space \
  Naming_Context \
  Registry_Name_Space \
  Remote_Name_Space \
  NT_Service

Codecs = \
  Codecs

Token = \
  Local_Tokens \
  Remote_Tokens \
  Token_Collection \
  Token_Invariants \
  Token_Manager \
  Token_Request_Reply

Svcconf = \
  DLL \
  DLL_Manager \
  Dynamic_Service_Base \
  Parse_Node \
  Service_Config \
  Service_Manager \
  Service_Object \
  Service_Repository \
  Service_Types \
  Service_Templates \
  Shared_Object \
  Svc_Conf_l \
  Svc_Conf_y \
  Svc_Conf_Lexer_Guard \
  XML_Svc_Conf

UUID = \
  UUID

Filecache = \
  Filecache

ACE_OS = \
  Basic_Types \
  Time_Value \
  Cleanup \
  Object_Manager_Base \
  OS_main \
  OS_NS_arpa_inet \
  OS_NS_ctype \
  OS_NS_dirent \
  OS_NS_dlfcn \
  OS_NS_errno \
  OS_NS_fcntl \
  OS_NS_math \
  OS_NS_netdb \
  OS_NS_poll \
  OS_NS_pwd \
  OS_NS_regex \
  OS_NS_signal \
  OS_NS_stdio \
  OS_NS_stdlib \
  OS_NS_string \
  OS_NS_strings \
  OS_NS_stropts \
  OS_NS_sys_mman \
  OS_NS_sys_msg \
  OS_NS_sys_resource \
  OS_NS_sys_select \
  OS_NS_sys_shm \
  OS_NS_sys_socket \
  OS_NS_sys_stat \
  OS_NS_sys_time \
  OS_NS_sys_uio \
  OS_NS_sys_utsname \
  OS_NS_sys_wait \
  OS_NS_Thread \
  OS_NS_time \
  OS_NS_unistd \
  OS_NS_wchar \
  OS_QoS \
  OS_TLI \
  OS_Errno \
  ARGV \
  Argv_Type_Converter \
  Base_Thread_Adapter \
  OS_Thread_Adapter \
  OS_Log_Msg_Attributes \
  Thread_Hook \
  Sched_Params \
  Handle_Set \
  Copy_Disabled \
  Date_Time \
  gethrtime

Utils = \
  ACE \
  ACE_crc32 \
  ACE_crc_ccitt \
  Active_Map_Manager \
  Arg_Shifter \
  Capabilities \
  Containers \
  Configuration \
  Configuration_Import_Export \
  Dirent \
  Dirent_Selector \
  Dynamic \
  Flag_Manip \
  Framework_Component \
  Functor \
  Functor_String \
  Get_Opt \
  Hash_Map_Manager \
  Connection_Recycling_Strategy \
  Hashable \
  Notification_Strategy \
  Recyclable \
  Refcountable \
  Handle_Ops \
  Init_ACE \
  Lib_Find \
  Message_Block \
  Method_Request \
  Object_Manager \
  Registry \
  String_Base_Const \
  SString \
  Stats \
  Container_Instantiations \
  Sample_History

Logging = \
  Dump \
  Log_Msg \
  Log_Msg_Callback \
  Log_Msg_Backend \
  Log_Msg_IPC \
  Log_Msg_NT_Event_Log \
  Log_Msg_UNIX_Syslog \
  Log_Record \
  Logging_Strategy \
  Trace

Threads = \
  Activation_Queue \
  Atomic_Op \
  Process \
  Process_Manager \
  TSS_Adapter \
  Auto_Event \
  Manual_Event \
  Barrier \
  Condition_Thread_Mutex \
  Condition_Recursive_Thread_Mutex \
  Event \
  Lock \
  Mutex \
  RW_Mutex \
  RW_Thread_Mutex \
  Recursive_Thread_Mutex \
  Semaphore \
  Thread_Mutex \
  Thread_Semaphore \
  Synch_Options \
  Process_Semaphore \
  Process_Mutex \
  RW_Process_Mutex \
  File_Lock \
  Thread \
  Thread_Manager \
  Thread_Adapter \
  Thread_Exit \
  Thread_Control \
  Token

Demux = \
  Event_Handler \
  FlReactor \
  Msg_WFMO_Reactor \
  POSIX_Proactor \
  POSIX_CB_Proactor \
  WIN32_Proactor \
  Priority_Reactor \
  Proactor \
  Reactor \
  Select_Reactor \
  Select_Reactor_Base \
  SUN_Proactor \
  Dev_Poll_Reactor \
  TP_Reactor \
  TkReactor \
  WFMO_Reactor \
  XtReactor \
  QtReactor

Connection = \
  Asynch_IO \
  Asynch_IO_Impl \
  Asynch_Pseudo_Task \
  POSIX_Asynch_IO \
  WIN32_Asynch_IO

Sockets = \
  Addr \
  INET_Addr \
  IPC_SAP \
  ICMP_Socket \
  LSOCK \
  LSOCK_Acceptor \
  LSOCK_CODgram \
  LSOCK_Connector \
  LSOCK_Dgram \
  LSOCK_Stream \
  Multihomed_INET_Addr \
  Ping_Socket \
  SOCK \
  SOCK_Acceptor \
  SOCK_CODgram \
  Sock_Connect \
  SOCK_Connector \
  SOCK_Dgram \
  SOCK_Dgram_Bcast \
  SOCK_Dgram_Mcast \
  SOCK_IO \
  SOCK_SEQPACK_Acceptor \
  SOCK_SEQPACK_Association \
  SOCK_SEQPACK_Connector \
  SOCK_Stream

IPC = \
  ATM_Addr \
  ATM_Acceptor \
  ATM_Connector \
  ATM_Params \
  ATM_QoS \
  ATM_Stream \
  XTI_ATM_Mcast \
  DEV \
  DEV_Addr \
  DEV_Connector \
  DEV_IO \
  FIFO \
  FIFO_Recv \
  FIFO_Recv_Msg \
  FIFO_Send \
  FIFO_Send_Msg \
  FILE_Addr \
  FILE \
  FILE_Connector \
  FILE_IO \
  IO_SAP \
  IOStream \
  Pipe \
  Signal \
  SPIPE_Addr \
  SPIPE \
  SPIPE_Acceptor \
  SPIPE_Connector \
  SPIPE_Stream \
  SV_Message \
  SV_Message_Queue \
  SV_Semaphore_Complex \
  SV_Semaphore_Simple \
  SV_Shared_Memory \
  TLI \
  TLI_Acceptor \
  TLI_Connector \
  TLI_Stream \
  TTY_IO \
  UNIX_Addr \
  UPIPE_Acceptor \
  UPIPE_Connector \
  UPIPE_Stream \
  MEM_Acceptor \
  MEM_Addr \
  MEM_Connector \
  MEM_IO \
  MEM_SAP \
  MEM_Stream

Streams = \
  CDR_Base \
  CDR_Stream \
  Codeset_IBM1047 \
  Codeset_Registry \
  Codeset_Registry_db \
  Message_Queue \
  Reactor_Notification_Strategy \
  Task

Memory = \
  Based_Pointer_Repository \
  Malloc \
  PI_Malloc \
  Local_Memory_Pool \
  MMAP_Memory_Pool \
  Malloc_Allocator \
  Malloc_Instantiations \
  Mem_Map \
  Obchunk \
  Obstack \
  Pagefile_Memory_Pool \
  Read_Buffer \
  Sbrk_Memory_Pool \
  Shared_Memory \
  Shared_Memory_MM \
  Shared_Memory_SV \
  Shared_Memory_Pool

Timer = \
  Basic_Stats \
  High_Res_Timer \
  Profile_Timer \
  System_Time \
  Time_Request_Reply \
  Timeprobe \
  Timer_Hash \
  Timer_Heap \
  Timer_List \
  Timer_Queue \
  Timer_Wheel

Metrics = \
  Metrics_Cache

FILES += \
         $(Other) \
         $(Codecs) \
         $(Token) \
         $(Svcconf) \
         $(UUID) \
         $(Filecache) \
         $(ACE_OS) \
         $(Utils) \
         $(Logging) \
         $(Threads) \
         $(Demux) \
         $(Connection) \
         $(Sockets) \
         $(IPC) \
         $(Streams) \
         $(Memory) \
         $(Timer) \
         $(Metrics)

RESOURCES += \
  ace.rc

#----------------------------------------------------------------------------
#       Include macros and targets
#----------------------------------------------------------------------------
ACE_SHLIBS =

INSLIB ?= ../lib
ifeq ($(INSLIB),.)
  ifeq ($(PWD),)
    PWD=$(shell pwd)
  endif
  INSLIB = $(PWD)
endif
OUTPUT_DIRECTORY = $(INSLIB)

include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
## We don't need the ACELIB setting from wrapper_macros.GNU
ACELIB =

ifeq ($(versioned_so),1)
SOVERSION = .5.4.3
endif

# To build multiple targets in the same directory on AIX, it works
# best to have a template directory per project.
# The compiler/linker isn't too smart about instantiating templates...
ifdef TEMPINCDIR
TEMPINCDIR := $(TEMPINCDIR)/ACE

all: $(TEMPINCDIR)

endif

ifneq ($(OUTPUT_DIRECTORY),)
all: $(OUTPUT_DIRECTORY)

$(OUTPUT_DIRECTORY):
	-@$(MKDIR) "$(OUTPUT_DIRECTORY)"
endif

LIBCHECK = 1
ifneq ($(LIBCHECK), 1)
  LIB   =
  SHLIB =
  all: lib_warning
endif

ifneq (,$(RC))
  FILES += $(RESOURCES)
endif

LSRC   = $(addsuffix .cpp, $(FILES))

include $(ACE_ROOT)/include/makeinclude/macros.GNU
include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU
include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
ifeq ($(VXWORKSLINK),true)
include $(TGT_DIR)/h/make/rules.$(PRJ_TYPE)
endif

ifeq ($(VXWORKSLINK),true)
LDLIBPATH     = -L../lib
else
LDFLAGS      += -L../lib
endif
CPPFLAGS     += -I..
CPPFLAGS     += -DACE_HAS_ACE_TOKEN -DACE_HAS_ACE_SVCCONF
ifeq ($(shared_libs),1)
  ifneq ($(SHLIB),)
    CPPFLAGS += -DACE_BUILD_DLL
  endif
endif
ifeq ($(static_libs),1)
  CPPFLAGS += -DACE_AS_STATIC_LIBS
endif

#----------------------------------------------------------------------------
#       Local targets
#----------------------------------------------------------------------------
Svc_Conf_y.cpp: Svc_Conf.y
	$(YACC) -l -d Svc_Conf.y
	sed -e 's/char \*getenv/char *ace_foo/g' \
            -e 's/= getenv/= ACE_OS::getenv/g' \
            -e 's/fprintf/ACE_OS::fprintf/g' \
            -e 's/yy/ace_yy/g' \
            -e 's/->ace_yyerrno/->yyerrno/g' \
            -e 's/->ace_yylineno/->yylineno/g' \
            -e 's/YY/ACE_YY/g' \
            -e 's/Svc_Conf\.tab\.c/Svc_Conf_y.cpp/g' < Svc_Conf.tab.c > /tmp/$@
	cp /tmp/$@ $@
	patch < ../etc/Svc_Conf_y.cpp.diff
	echo // '$ace.mpc,v 1.45 2004/11/29 20:11:39 elliott_c Exp$' > Svc_Conf_Tokens.h
	cat Svc_Conf.tab.h >> Svc_Conf_Tokens.h
	$(RM) -f /tmp/$@ Svc_Conf.tab.c Svc_Conf.tab.h Svc_Conf_y.cpp.orig

Svc_Conf_l.cpp: Svc_Conf.l
	$(LEX) -L -t -I Svc_Conf.l > $@
	sed -e 's/unistd/stdio/g' \
            -e 's/yy/ace_yy/g' \
            -e 's/YY/ACE_YY/g' \
            -e 's/->ace_yyerrno/->yyerrno/g' \
            -e 's/->ace_yylineno/->yylineno/g' \
            -e 's/free( ptr );/free( ACE_MALLOC_T (ptr) );/g' \
            -e 's/exit( 1 );/ACE_OS::exit( 1 );/g' \
            -e 's/isatty( fileno(file)/ACE_OS::isatty( fileno (file)/g' \
            -e 's/int isatty/int nop_isatty/g' \
            -e 's/realloc( ptr, size );/realloc( ACE_MALLOC_T (ptr), size );/g' \
            -e 's@#include <stdio.h>@#include /**/ "ace/OS.h"@' \
            -e 's@#include <@#include /**/ <@' \
            -e 's@ECHO@ACE_SVC_CONF_ECHO@' < $@ > /tmp/$@
	cp /tmp/$@ $@
	patch < ../etc/Svc_Conf_l.cpp.diff
	$(RM) -f /tmp/$@ Svc_Conf_l.cpp.orig

lib_warning:
	@echo This project will not be built due to the following missing library:
	@echo $(LIBCHECK)


realclean: clean
ifneq ($(GENERATED_DIRTY),)
	-$(RM) -r $(GENERATED_DIRTY)
endif

