Skip to content

Commit

Permalink
Various changes to clean up makefiles a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
dgboone committed Jan 15, 2008
1 parent 4f33932 commit 395349d
Show file tree
Hide file tree
Showing 34 changed files with 91 additions and 529 deletions.
62 changes: 53 additions & 9 deletions Makefile.mak
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,67 @@
#
# **********************************************************************

root_dir = .
top_srcdir = cpp
!include cpp/config/Make.rules.mak

!include $(root_dir)/config/Make.rules.mak

SUBDIRS = slice cpp java
SUBDIRS = cpp java py
DEPEND_SUBDIRS = cpp py
INSTALL_SUBDIRS = cpp py

!if "$(CPP_COMPILER)" == "VC60"
SUBDIRS = $(SUBDIRS) php rb
!endif

!if "$(CPP_COMPILER)" == "VC80"
SUBDIRS = $(SUBDIRS) cs py vb
SUBDIRS = $(SUBDIRS) php rb
DEPEND_SUBDIRS = $(DEPEND_SUBDIRS) php rb
INSTALL_SUBDIRS = $(INSTALL_SUBDIRS) php rb
!else
SUBDIRS = $(SUBDIRS) cs vb
DEPEND_SUBDIRS = $(DEPEND_SUBDIRS) cs vb
INSTALL_SUBDIRS = $(INSTALL_SUBDIRS) cs
!endif

$(EVERYTHING)::
@for %i in ( $(SUBDIRS) ) do \
@echo "making $@ in %i" && \
cmd /c "cd %i && $(MAKE) -nologo -f Makefile.mak $(MAKEFLAGS) $@" || exit 1

all clean::
@for %i in ( $(SUBDIRS) ) do \
@echo "making $@ in %i" && \
cmd /c "cd %i && $(MAKE) -nologo -f Makefile.mak $(MAKEFLAGS) $@" || exit 1

depend::
@for %i in ( $(DEPEND_SUBDIRS) ) do \
@echo "making depend in %i" && \
cmd /c "cd %i && $(MAKE) -nologo -f Makefile.mak $(MAKEFLAGS) depend" || exit 1

install::
@for %i in ( $(INSTALL_SUBDIRS) ) do \
@echo "making install in %i" && \
cmd /c "cd %i && $(MAKE) -nologo -f Makefile.mak $(MAKEFLAGS) install" || exit 1

cpp::
@echo "making all in cpp" && \
cmd /c "cd cpp && $(MAKE) -nologo -f Makefile.mak $(MAKEFLAGS) all" || exit 1

java::
@echo "making all in java" && \
cmd /c "cd java && $(MAKE) -nologo -f Makefile.mak $(MAKEFLAGS) all" || exit 1

cs::
@echo "making all in cs" && \
cmd /c "cd cs && $(MAKE) -nologo -f Makefile.mak $(MAKEFLAGS) all" || exit 1

vb::
@echo "making all in vb" && \
cmd /c "cd vb && $(MAKE) -nologo -f Makefile.mak $(MAKEFLAGS) all" || exit 1

py::
@echo "making all in py" && \
cmd /c "cd py && $(MAKE) -nologo -f Makefile.mak $(MAKEFLAGS) all" || exit 1

rb::
@echo "making all in rb" && \
cmd /c "cd rb && $(MAKE) -nologo -f Makefile.mak $(MAKEFLAGS) all" || exit 1

php::
@echo "making all in php" && \
cmd /c "cd php && $(MAKE) -nologo -f Makefile.mak $(MAKEFLAGS) all" || exit 1
13 changes: 0 additions & 13 deletions config/Make.rules.mak

This file was deleted.

7 changes: 7 additions & 0 deletions cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ endif
fi ; \
done

cd ../slice ; \
for subdir in * ; \
do \
echo "Copying slice/$$subdir to $(install_slicedir)..." ; \
cp -fpr $$subdir $(install_slicedir) ; \
done ;

$(EVERYTHING)::
@for subdir in $(SUBDIRS); \
do \
Expand Down
3 changes: 3 additions & 0 deletions cpp/Makefile.mak
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ $(EVERYTHING)::
@for %i in ( $(SUBDIRS) ) do \
@echo "making $@ in %i" && \
cmd /c "cd %i && $(MAKE) -nologo -f Makefile.mak $@" || exit 1
install::
@echo "Copying slice files..." && \
cmd /c "xcopy /s /y ..\slice $(install_slicedir)" || exit 1

install::
copy ICE_LICENSE $(prefix)
Expand Down
2 changes: 1 addition & 1 deletion cpp/demo/Freeze/casino/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ CasinoClient::run(int argc, char* argv[])
//
// Initialize pseudo-random number generator
//
srand(IceUtil::Time::now().toMicroSeconds());
srand((unsigned int)IceUtil::Time::now().toMicroSeconds());

cout << "Retrieve bank and players... " << flush;

Expand Down
2 changes: 1 addition & 1 deletion cpp/demo/Freeze/casino/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ CasinoServer::run(int argc, char* argv[])
//
// Initialize pseudo-random number generator
//
srand(IceUtil::Time::now().toMicroSeconds());
srand((unsigned int)IceUtil::Time::now().toMicroSeconds());

Ice::PropertiesPtr properties = communicator()->getProperties();

Expand Down
21 changes: 6 additions & 15 deletions cs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,12 @@ install::
$(call mkdir,$(install_slicedir)) ; \
fi

@if test -d slice ; \
then \
cd slice ; \
for subdir in * ; \
do \
echo "Copying slice/$$subdir to $(install_slicedir)..." ; \
cp -fpr $$subdir $(install_slicedir) ; \
done ; \
fi

@if test ! -d $(install_docdir) ; \
then \
echo "Creating $(install_docdir)..." ; \
$(call mkdir,$(install_docdir)) ; \
fi
cd ../slice ; \
for subdir in * ; \
do \
echo "Copying slice/$$subdir to $(install_slicedir)..." ; \
cp -fpr $$subdir $(install_slicedir) ; \
done ; \

$(EVERYTHING)::
@for subdir in $(SUBDIRS); \
Expand Down
5 changes: 2 additions & 3 deletions cs/Makefile.mak
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ $(EVERYTHING)::
cmd /c "cd %i && $(MAKE) -nologo -f Makefile.mak $@" || exit 1

install::
@if exist slice \
@echo "making $@ in slice" && \
cmd /c "cd slice && $(MAKE) -nologo -f Makefile.mak $@" || exit 1
@echo "Copying slice files..." && \
cmd /c "xcopy /s /y ..\slice $(install_slicedir)" || exit 1

install::
copy ICE_LICENSE $(prefix)
Expand Down
6 changes: 1 addition & 5 deletions cs/config/Make.rules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,7 @@
ifneq ($(USE_ICE_RPM),0)
slicedir = /usr/share/Ice-$(VERSION)/slice
else
ifeq ($(shell test -d $(ICE_DIR)/slice && echo 0),0)
slicedir = $(ICE_DIR)/slice
else
slicedir = $(ICE_DIR)/../slice
endif
slicedir = $(top_srcdir)/../slice
endif


Expand Down
10 changes: 1 addition & 9 deletions cs/config/Make.rules.mak.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,7 @@
bindir = $(top_srcdir)\bin
libdir = $(top_srcdir)\lib
#
# If a slice directory is contained along with this distribution -- use it.
#
!if exist("$(ICE_DIR)\slice")
slicedir = $(ICE_DIR)\slice
!else
slicedir = $(ICE_DIR)\..\slice
!endif
slicedir = $(top_srcdir)\..\slice
install_bindir = $(prefix)\bin
install_libdir = $(prefix)\lib
Expand Down
25 changes: 1 addition & 24 deletions php/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ include $(top_srcdir)/config/Make.rules

SUBDIRS = src

INSTALL_SUBDIRS = $(install_libdir) $(install_slicedir)
INSTALL_SUBDIRS = $(install_libdir)

install::
@if test ! -d $(prefix) ; \
Expand All @@ -38,29 +38,6 @@ $(EVERYTHING)::
( cd $$subdir && $(MAKE) $@ ) || exit 1; \
done

install::
@if test -d slice ; \
then \
cd slice ; \
for i in * ; \
do \
if test ! -d $(install_slicedir)/$$i ; \
then \
echo "Creating $(install_slicedir)/$$i..." ; \
mkdir $(install_slicedir)/$$i ; \
chmod a+rx $(install_slicedir)/$$i ; \
fi ; \
cd $$i ; \
for f in *.ice ; \
do \
echo "Installing $$i/$$f" ; \
$(INSTALL_DATA) $$f $(install_slicedir)/$$i ; \
chmod a+r $(install_slicedir)/$$i/$$f ; \
done ; \
cd .. ; \
done \
fi

install::
$(call installdata,ICE_LICENSE,$(prefix))
$(call installdata,LICENSE,$(prefix))
Expand Down
7 changes: 1 addition & 6 deletions php/Makefile.mak
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ top_srcdir = .

SUBDIRS = src

INSTALL_SUBDIRS = $(install_bindir) $(install_slicedir)
INSTALL_SUBDIRS = $(install_bindir)

install::
@if not exist $(prefix) \
Expand All @@ -30,11 +30,6 @@ $(EVERYTHING)::
@echo "making $@ in %i" && \
cmd /c "cd %i && $(MAKE) -nologo -f Makefile.mak $@" || exit 1

install::
@if exist slice \
@echo "making $@ in slice" && \
cmd /c "cd slice && $(MAKE) -nologo -f Makefile.mak $@" || exit 1

install::
copy ICE_LICENSE $(prefix)
copy LICENSE $(prefix)
Expand Down
12 changes: 2 additions & 10 deletions php/config/Make.rules
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,7 @@ UNAME := $(shell uname)
#
# Locate and load platform specific definitions.
#
ifeq ($(shell test -f $(ICE_DIR)/cpp/config/Make.rules.$(UNAME) && echo 0),0)
configdir = $(ICE_DIR)/cpp/config
else
configdir = $(ICE_DIR)/config
endif
configdir = $(top_srcdir)/../cpp/config

include $(configdir)/Make.rules.$(UNAME)

Expand Down Expand Up @@ -168,11 +164,7 @@ endif
ifneq ($(USE_ICE_RPM),0)
slicedir = /usr/share/Ice-$(VERSION)/slice
else
ifeq ($(shell test -d $(ICE_DIR)/slice && echo 0),0)
slicedir = $(ICE_DIR)/slice
else
slicedir = $(ICE_DIR)/../slice
endif
slicedir = $(top_srcdir)/../slice
endif

ifeq ($(LP64),yes)
Expand Down
12 changes: 2 additions & 10 deletions php/config/Make.rules.mak
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ SOVERSION = 33
bindir = $(top_srcdir)\bin
libdir = $(top_srcdir)\lib

!if exist ("$(ICE_DIR)\slice")
slicedir = $(ICE_DIR)\slice
!else
slicedir = $(ICE_DIR)\..\slice
!endif
slicedir = $(top_srcdir)\..\slice

install_libdir = $(prefix)\bin
install_libdir = $(prefix)\lib
Expand All @@ -72,11 +68,7 @@ install_slicedir = $(prefix)\slice
THIRDPARTY_HOME = $(STLPORT_HOME)
CPP_COMPILER = VC60

!if exist ($(ICE_DIR)\config\Make.rules.msvc)
!include $(ICE_DIR)\config\Make.rules.msvc
!else
!include $(ICE_DIR)\cpp\config\Make.rules.msvc
!endif
!include $(top_srcdir)\..\cpp\config\Make.rules.msvc

!if "$(OPTIMIZE)" != "yes"
LIBSUFFIX = $(LIBSUFFIX)d
Expand Down
16 changes: 4 additions & 12 deletions py/config/Make.rules
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,10 @@ UNAME := $(shell uname)
#
# Platform specific definitions
#
ifeq ($(shell test -f $(ICE_DIR)/../py/config/Make.rules.$(UNAME) && echo 0),0)
configdir = $(ICE_DIR)/../py/config
ifeq ($(shell test -f $(top_srcdir)/config/Make.rules.$(UNAME) && echo 0),0)
configdir = $(top_srcdir)/config
else
ifeq ($(shell test -f $(ICE_DIR)/cpp/config/Make.rules.$(UNAME) && echo 0),0)
configdir = $(ICE_DIR)/cpp/config
else
configdir = $(ICE_DIR)/config
endif
configdir = $(top_srcdir)/../cpp/config
endif

include $(configdir)/Make.rules.$(UNAME)
Expand Down Expand Up @@ -180,11 +176,7 @@ endif
ifneq ($(USE_ICE_RPM),0)
slicedir = /usr/share/Ice-$(VERSION)/slice
else
ifeq ($(shell test -d $(ICE_DIR)/slice && echo 0),0)
slicedir = $(ICE_DIR)/slice
else
slicedir = $(ICE_DIR)/../slice
endif
slicedir = $(top_srcdir)/../slice
endif

install_libdir = $(prefix)/python
Expand Down
12 changes: 2 additions & 10 deletions py/config/Make.rules.mak
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,7 @@ THIRDPARTY_HOME = $(STLPORT_HOME)
!error Invalid setting for CPP_COMPILER: $(CPP_COMPILER)
!endif

!if exist ($(ICE_DIR)\config\Make.rules.msvc)
!include $(ICE_DIR)\config\Make.rules.msvc
!else
!include $(ICE_DIR)\cpp\config\Make.rules.msvc
!endif
!include $(top_srcdir)\..\cpp\config\Make.rules.msvc

!if "$(OPTIMIZE)" != "yes"
LIBSUFFIX = $(LIBSUFFIX)d
Expand All @@ -106,11 +102,7 @@ ICE_CPPFLAGS = -I"$(ICE_DIR)\include"
ICE_LDFLAGS = /LIBPATH:"$(ICE_DIR)\lib"
!endif

!if exist ("$(ICE_DIR)\slice")
slicedir = $(ICE_DIR)\slice
!else
slicedir = $(ICE_DIR)\..\slice
!endif
slicedir = $(top_srcdir)\..\slice

PYTHON_CPPFLAGS = -I"$(PYTHON_HOME)\include"
PYTHON_LDFLAGS = /LIBPATH:"$(PYTHON_HOME)\libs"
Expand Down
12 changes: 2 additions & 10 deletions rb/config/Make.rules
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,7 @@ rubydir = $(top_srcdir)/ruby
ifneq ($(USE_ICE_RPM),0)
slicedir = /usr/share/Ice-$(VERSION)/slice
else
ifeq ($(shell test -d $(ICE_DIR)/slice && echo 0),0)
slicedir = $(ICE_DIR)/slice
else
slicedir = $(ICE_DIR)/../slice
endif
slicedir = $(top_srcdir)/../slice
endif

install_bindir = $(prefix)/bin
Expand All @@ -127,11 +123,7 @@ UNAME := $(shell uname)
#
# Platform specific definitions
#
ifeq ($(shell test -f $(ICE_DIR)/cpp/config/Make.rules.$(UNAME) && echo 0),0)
configdir = $(ICE_DIR)/cpp/config
else
configdir = $(ICE_DIR)/config
endif
configdir = $(top_srcdir)/../cpp/config

include $(configdir)/Make.rules.$(UNAME)

Expand Down
Loading

0 comments on commit 395349d

Please sign in to comment.