2002-04-02 14:58:18 +08:00
|
|
|
|
2003-03-13 10:53:40 +08:00
|
|
|
default: opt
|
2002-04-02 14:58:18 +08:00
|
|
|
|
2005-03-13 09:47:46 +08:00
|
|
|
opt: \
|
2006-03-02 23:26:12 +08:00
|
|
|
$(EXEC:=.opt) \
|
|
|
|
$(LIB:=.opt) \
|
|
|
|
$(WRAPPER:=.opt) \
|
|
|
|
$(PLUGIN:=.opt) \
|
2002-04-02 14:58:18 +08:00
|
|
|
|
2005-03-13 09:47:46 +08:00
|
|
|
debug: \
|
2006-03-02 23:26:12 +08:00
|
|
|
$(EXEC:=.dbg) \
|
|
|
|
$(LIB:=.dbg) \
|
|
|
|
$(WRAPPER:=.dbg) \
|
|
|
|
$(PLUGIN:=.dbg) \
|
2002-04-02 14:58:18 +08:00
|
|
|
|
2006-03-02 23:26:12 +08:00
|
|
|
static: \
|
|
|
|
$(LIB:.$(LIB_EXT)=.static) \
|
|
|
|
$(PLUGIN:.$(PLUGIN_EXT)=.static) \
|
2005-03-13 09:47:46 +08:00
|
|
|
|
2006-03-02 23:26:12 +08:00
|
|
|
staticdebug: \
|
|
|
|
$(LIB:.$(LIB_EXT)=.staticdbg) \
|
|
|
|
$(PLUGIN:.$(LIB_EXT)=.staticdbg) \
|
2005-03-13 09:47:46 +08:00
|
|
|
|
2003-03-13 10:53:40 +08:00
|
|
|
cleandepend: cleandependopt cleandependdbg
|
2002-04-02 14:58:18 +08:00
|
|
|
|
2003-03-13 10:53:40 +08:00
|
|
|
cleandependopt:
|
|
|
|
@[ -d $(OPTDIR) ] && cd $(OPTDIR); rm -f Makedepend; rm -rf .depend
|
2002-04-12 13:06:41 +08:00
|
|
|
|
2003-03-13 10:53:40 +08:00
|
|
|
cleandependdbg:
|
|
|
|
@[ -d $(DEBUGDIR) ] && cd $(DEBUGDIR); rm -f Makedepend; rm -rf .depend
|
2002-04-12 13:06:41 +08:00
|
|
|
|
2003-03-13 10:53:40 +08:00
|
|
|
cleantarget: cleantargetopt cleantargetdbg
|
2002-04-12 13:06:41 +08:00
|
|
|
|
2003-03-13 10:53:40 +08:00
|
|
|
cleantargetopt:
|
2005-12-09 23:05:50 +08:00
|
|
|
@[ -d $(OPTDIR) ] && cd $(OPTDIR); rm -f $(EXEC)$(EXE_EXT) $(LIB) ${WRAPPER} $(PLUGIN)
|
2002-04-02 14:58:18 +08:00
|
|
|
|
2003-03-13 10:53:40 +08:00
|
|
|
cleantargetdbg:
|
2005-12-09 23:05:50 +08:00
|
|
|
@[ -d $(DEBUGDIR) ] && cd $(DEBUGDIR); rm -f $(EXEC)$(EXE_EXT) $(LIB) ${WRAPPER} $(PLUGIN)
|
2002-04-02 14:58:18 +08:00
|
|
|
|
2003-03-13 10:53:40 +08:00
|
|
|
clean: cleanopt cleandbg
|
2002-04-02 14:58:18 +08:00
|
|
|
|
2003-03-13 10:53:40 +08:00
|
|
|
cleanopt:
|
|
|
|
@[ -d $(OPTDIR) ] && cd $(OPTDIR); rm -f $(OBJS) Makedepend; rm -rf .depend
|
2002-04-02 14:58:18 +08:00
|
|
|
|
2003-03-13 10:53:40 +08:00
|
|
|
cleandbg:
|
|
|
|
@[ -d $(DEBUGDIR) ] && cd $(DEBUGDIR); rm -f $(OBJS) Makedepend; rm -rf .depend
|
2002-04-12 13:06:41 +08:00
|
|
|
|
2003-03-13 10:53:40 +08:00
|
|
|
clobber: clobberdbg clobberopt
|
2002-04-02 14:58:18 +08:00
|
|
|
|
2003-03-13 10:53:40 +08:00
|
|
|
clobberopt:
|
2002-04-02 14:58:18 +08:00
|
|
|
rm -rf $(OPTDIR)
|
|
|
|
|
2003-03-13 10:53:40 +08:00
|
|
|
clobberdbg:
|
2002-04-02 14:58:18 +08:00
|
|
|
rm -rf $(DEBUGDIR)
|
|
|
|
|
|
|
|
|
2003-03-13 10:53:40 +08:00
|
|
|
beautify:
|
2002-04-02 14:58:18 +08:00
|
|
|
for f in *.cpp ; do mv $$f $$f.bak; bcpp $$f.bak $$f; rm $$f.bak; done
|
|
|
|
for f in *.h ; do mv $$f $$f.bak; bcpp $$f.bak $$f; rm $$f.bak; done
|
|
|
|
|
|
|
|
docs:
|
|
|
|
[ "$(TARGET_BASENAME)" != "" ] && \
|
|
|
|
mkdir -p $(TOPDIR)/doc/doc++/$(TARGET_BASENAME) && \
|
|
|
|
doc++ -d $(TOPDIR)/doc/doc++/$(TARGET_BASENAME) -H -A \
|
|
|
|
$(TOPDIR)/include/$(TARGET_BASENAME)/* && \
|
2006-03-02 23:26:12 +08:00
|
|
|
echo "$(TARGET_BASENAME) HTML documentation created in " \
|
2002-04-02 14:58:18 +08:00
|
|
|
"$(TOPDIR)/doc/doc++/$(TARGET_BASENAME)"
|
|
|
|
|
2002-04-05 09:52:15 +08:00
|
|
|
|
2003-03-13 10:53:40 +08:00
|
|
|
$(EXEC): $(OBJS)
|
2002-04-02 14:58:18 +08:00
|
|
|
$(C++) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
|
|
|
|
|
|
|
|
|
|
|
|
## Mac OSX makes the distinction between -dynamiclib and -bundle
|
|
|
|
## causing us to have to make a special case here, rather than
|
|
|
|
## just redefining the SHARED argument.
|
|
|
|
|
|
|
|
ifeq ($(OS),Darwin)
|
|
|
|
|
2003-03-13 10:53:40 +08:00
|
|
|
$(LIB): $(OBJS)
|
2003-08-08 22:41:37 +08:00
|
|
|
$(C++) $(LDFLAGS) $(LIBVERSION) -dynamiclib $(OBJS) $(LIBS) -o $@
|
2002-04-02 14:58:18 +08:00
|
|
|
|
2004-12-09 13:29:10 +08:00
|
|
|
$(WRAPPER) $(PLUGIN): $(OBJS)
|
2002-04-02 14:58:18 +08:00
|
|
|
$(C++) $(LDFLAGS) -bundle $(OBJS) $(LIBS) -o $@
|
2004-12-09 13:29:10 +08:00
|
|
|
|
2005-03-13 09:47:46 +08:00
|
|
|
$(PLUGIN): $(OBJS)
|
|
|
|
$(C++) $(LDFLAGS) -bundle $(OBJS) $(LIBS) -o $@
|
|
|
|
|
2002-04-02 14:58:18 +08:00
|
|
|
else
|
2005-03-13 09:47:46 +08:00
|
|
|
ifeq ($(OS),HP-UX)
|
2004-12-09 13:29:10 +08:00
|
|
|
|
2002-07-23 18:48:22 +08:00
|
|
|
# we need to explicitly tell the linker the library name - else it will
|
|
|
|
# include paths like ../../../libosg.sl into executables
|
2004-12-09 13:29:10 +08:00
|
|
|
$(LIB) $(PLUGIN) ${WRAPPER} : $(OBJS)
|
2002-07-23 23:01:51 +08:00
|
|
|
$(C++) $(LDFLAGS) $(SHARED) $(OBJS) $(LIBS) -Wl,+h -Wl,$@ -o $@
|
2005-03-13 09:47:46 +08:00
|
|
|
|
|
|
|
else
|
|
|
|
|
2004-12-09 13:29:10 +08:00
|
|
|
$(LIB) $(PLUGIN) ${WRAPPER} : $(OBJS)
|
2002-04-02 14:58:18 +08:00
|
|
|
$(C++) $(LDFLAGS) $(SHARED) $(OBJS) $(LIBS) -o $@
|
|
|
|
|
2005-03-13 09:47:46 +08:00
|
|
|
$(STATICLIB) $(STATICPLUGIN): $(OBJS)
|
|
|
|
ar rv $@ $?
|
|
|
|
|
|
|
|
endif # not HP-UX
|
2002-07-23 18:48:22 +08:00
|
|
|
endif # not Darwin
|
2002-04-02 14:58:18 +08:00
|
|
|
|
|
|
|
$(EXEC:=.dbg) :
|
|
|
|
@[ -d $(DEBUGDIR) ] || mkdir $(DEBUGDIR)
|
|
|
|
@cd $(DEBUGDIR); \
|
2003-03-12 18:39:43 +08:00
|
|
|
$(MAKE) -f ../GNUmakefile "DOF=$(DBGF)" TOPDIR=../${TOPDIR} \
|
2006-03-02 23:26:12 +08:00
|
|
|
THISDIR=../$(THISDIR) \
|
2002-04-04 01:42:12 +08:00
|
|
|
MAKEDEPEND=Makedepend $(EXEC)
|
2004-09-02 11:52:13 +08:00
|
|
|
@$(MAKE) LNSRC=$(DEBUGDIR)/$(EXEC)$(EXE_EXT) LNDEST=$(BININST)/$(EXEC)$(EXE_EXT) __link
|
2002-04-02 14:58:18 +08:00
|
|
|
|
2004-12-09 13:29:10 +08:00
|
|
|
$(LIB:=.dbg) :
|
2002-04-02 14:58:18 +08:00
|
|
|
@[ -d $(DEBUGDIR) ] || mkdir $(DEBUGDIR)
|
2006-03-02 23:26:12 +08:00
|
|
|
@cd $(DEBUGDIR); \
|
2003-03-12 18:39:43 +08:00
|
|
|
$(MAKE) -f ../GNUmakefile "DOF=$(DBGF)" TOPDIR=../${TOPDIR} \
|
2006-03-02 23:26:12 +08:00
|
|
|
THISDIR=../$(THISDIR) \
|
2002-04-04 01:42:12 +08:00
|
|
|
MAKEDEPEND=Makedepend $(LIB)
|
2004-08-29 07:04:47 +08:00
|
|
|
@$(MAKE) LNSRC=$(DEBUGDIR)/$(LIB) LNDEST=$(LIBINST)/$(LIB) __link
|
2005-12-08 19:37:55 +08:00
|
|
|
ifdef IMP_LIB_EXT
|
2006-02-20 23:25:09 +08:00
|
|
|
@$(MAKE) LNSRC=$(DEBUGDIR)/lib$(TARGET_BASENAME).$(IMP_LIB_EXT) LNDEST=$(IMP_LIBINST)/lib$(TARGET_BASENAME).$(IMP_LIB_EXT) __link
|
2005-12-08 19:37:55 +08:00
|
|
|
endif
|
2002-04-02 14:58:18 +08:00
|
|
|
|
2005-03-13 09:47:46 +08:00
|
|
|
$(LIB:.$(LIB_EXT)=.staticdbg) :
|
|
|
|
@[ -d $(DEBUGDIR) ] || mkdir $(DEBUGDIR)
|
2006-03-02 23:26:12 +08:00
|
|
|
@cd $(DEBUGDIR); \
|
2005-03-13 09:47:46 +08:00
|
|
|
$(MAKE) -f ../GNUmakefile "DOF=$(DBGF)" TOPDIR=../${TOPDIR} \
|
2006-03-02 23:26:12 +08:00
|
|
|
THISDIR=../$(THISDIR) \
|
2005-03-13 09:47:46 +08:00
|
|
|
MAKEDEPEND=Makedepend $(STATICLIB)
|
|
|
|
@$(MAKE) LNSRC=$(DEBUGDIR)/$(STATICLIB) LNDEST=$(LIBINST)/$(OS)$(ARCH)/$(STATICLIB) __link
|
|
|
|
|
2004-12-09 13:29:10 +08:00
|
|
|
$(WRAPPER:=.dbg) :
|
|
|
|
@[ -d $(DEBUGDIR) ] || mkdir $(DEBUGDIR)
|
|
|
|
@cd $(DEBUGDIR); \
|
|
|
|
$(MAKE) -f ../GNUmakefile "DOF=$(DBGF)" TOPDIR=../${TOPDIR} \
|
2006-03-02 23:26:12 +08:00
|
|
|
THISDIR=../$(THISDIR) \
|
2004-12-09 13:29:10 +08:00
|
|
|
MAKEDEPEND=Makedepend $(WRAPPER)
|
|
|
|
@$(MAKE) LNSRC=$(DEBUGDIR)/$(WRAPPER) LNDEST=$(PLUGININST)/$(WRAPPER) __link
|
|
|
|
|
2002-04-02 14:58:18 +08:00
|
|
|
$(PLUGIN:=.dbg) :
|
|
|
|
@[ -d $(DEBUGDIR) ] || mkdir $(DEBUGDIR)
|
|
|
|
@cd $(DEBUGDIR); \
|
2003-03-12 18:39:43 +08:00
|
|
|
$(MAKE) -f ../GNUmakefile "DOF=$(DBGF)" TOPDIR=../${TOPDIR} \
|
2006-03-02 23:26:12 +08:00
|
|
|
THISDIR=../$(THISDIR) \
|
2002-04-04 01:42:12 +08:00
|
|
|
MAKEDEPEND=Makedepend $(PLUGIN)
|
2002-04-02 14:58:18 +08:00
|
|
|
@$(MAKE) LNSRC=$(DEBUGDIR)/$(PLUGIN) LNDEST=$(PLUGININST)/$(PLUGIN) __link
|
2005-12-08 19:37:55 +08:00
|
|
|
ifdef IMP_LIB_EXT
|
|
|
|
@$(MAKE) LNSRC=$(DEBUGDIR)/lib$(TARGET_BASENAME)$(IMP_LIB_EXT) LNDEST=$(IMP_PLUGININST)/lib$(TARGET_BASENAME).$(IMP_LIB_EXT) __link
|
|
|
|
endif
|
2002-04-02 14:58:18 +08:00
|
|
|
|
2005-03-13 09:47:46 +08:00
|
|
|
$(PLUGIN:.$(PLUGIN_EXT)=.staticdbg) :
|
|
|
|
@[ -d $(DEBUGDIR) ] || mkdir -p $(DEBUGDIR)
|
|
|
|
@cd $(DEBUGDIR); \
|
|
|
|
$(MAKE) -f ../GNUmakefile "DOF=$(DBGF)" TOPDIR=../${TOPDIR} \
|
2006-03-02 23:26:12 +08:00
|
|
|
THISDIR=../$(THISDIR) \
|
2005-03-13 09:47:46 +08:00
|
|
|
MAKEDEPEND=Makedepend STATICPLUGIN=$(PLUGIN:.$(PLUGIN_EXT)=.a) $(STATICPLUGIN)
|
|
|
|
@$(MAKE) LNSRC=$(DEBUGDIR)/$(STATICPLUGIN) LNDEST=$(PLUGININST)/$(STATICPLUGIN) __link
|
|
|
|
|
2002-04-02 14:58:18 +08:00
|
|
|
$(EXEC:=.opt) :
|
|
|
|
@[ -d $(OPTDIR) ] || mkdir $(OPTDIR)
|
|
|
|
@cd $(OPTDIR); \
|
2003-03-12 18:39:43 +08:00
|
|
|
$(MAKE) -f ../GNUmakefile DOF=$(OPTF) TOPDIR=../${TOPDIR} \
|
2006-03-02 23:26:12 +08:00
|
|
|
THISDIR=../$(THISDIR) \
|
2002-04-04 01:42:12 +08:00
|
|
|
MAKEDEPEND=Makedepend $(EXEC)
|
2004-09-02 11:52:13 +08:00
|
|
|
@$(MAKE) LNSRC=$(OPTDIR)/$(EXEC)$(EXE_EXT) LNDEST=$(BININST)/$(EXEC)$(EXE_EXT) __link
|
2002-04-02 14:58:18 +08:00
|
|
|
|
|
|
|
|
2003-01-28 04:40:08 +08:00
|
|
|
$(LIB:=.opt) :
|
|
|
|
@[ -d $(OPTDIR) ] || mkdir -p $(OPTDIR)
|
2006-03-02 23:26:12 +08:00
|
|
|
@cd $(OPTDIR); \
|
2003-03-12 18:39:43 +08:00
|
|
|
$(MAKE) -f ../GNUmakefile DOF=$(OPTF) TOPDIR=../${TOPDIR} \
|
2006-03-02 23:26:12 +08:00
|
|
|
THISDIR=../$(THISDIR) \
|
2002-04-04 01:42:12 +08:00
|
|
|
MAKEDEPEND=Makedepend $(LIB)
|
2004-08-29 07:04:47 +08:00
|
|
|
@$(MAKE) LNSRC=$(OPTDIR)/$(LIB) LNDEST=$(LIBINST)/$(LIB) __link
|
2005-12-08 19:37:55 +08:00
|
|
|
ifdef IMP_LIB_EXT
|
|
|
|
@$(MAKE) LNSRC=$(OPTDIR)/lib$(TARGET_BASENAME).$(IMP_LIB_EXT) LNDEST=$(IMP_LIBINST)/lib$(TARGET_BASENAME).$(IMP_LIB_EXT) __link
|
|
|
|
endif
|
2002-04-02 14:58:18 +08:00
|
|
|
|
2005-03-13 09:47:46 +08:00
|
|
|
$(LIB:.$(LIB_EXT)=.static) :
|
|
|
|
[ -d $(OPTDIR) ] || mkdir $(OPTDIR)
|
2006-03-02 23:26:12 +08:00
|
|
|
cd $(OPTDIR); \
|
2005-03-13 09:47:46 +08:00
|
|
|
$(MAKE) -f ../GNUmakefile DOF=$(OPTF) TOPDIR=../${TOPDIR} \
|
2006-03-02 23:26:12 +08:00
|
|
|
THISDIR=../$(THISDIR) \
|
2005-03-13 09:47:46 +08:00
|
|
|
MAKEDEPEND=Makedepend $(STATICLIB)
|
|
|
|
@$(MAKE) LNSRC=$(OPTDIR)/$(STATICLIB) LNDEST=$(LIBINST)/$(OS)$(ARCH)/$(STATICLIB) __link
|
|
|
|
|
2004-12-09 13:29:10 +08:00
|
|
|
$(WRAPPER:=.opt) :
|
|
|
|
@[ -d $(OPTDIR) ] || mkdir -p $(OPTDIR)
|
|
|
|
@cd $(OPTDIR); \
|
|
|
|
$(MAKE) -f ../GNUmakefile DOF=$(OPTF) TOPDIR=../${TOPDIR} \
|
2006-03-02 23:26:12 +08:00
|
|
|
THISDIR=../$(THISDIR) \
|
2004-12-09 13:29:10 +08:00
|
|
|
MAKEDEPEND=Makedepend $(WRAPPER)
|
|
|
|
@$(MAKE) LNSRC=$(OPTDIR)/$(WRAPPER) LNDEST=$(PLUGININST)/$(WRAPPER) __link
|
|
|
|
|
2002-04-02 14:58:18 +08:00
|
|
|
$(PLUGIN:=.opt) :
|
2003-01-28 04:40:08 +08:00
|
|
|
@[ -d $(OPTDIR) ] || mkdir -p $(OPTDIR)
|
2002-04-02 14:58:18 +08:00
|
|
|
@cd $(OPTDIR); \
|
2003-03-12 18:39:43 +08:00
|
|
|
$(MAKE) -f ../GNUmakefile DOF=$(OPTF) TOPDIR=../${TOPDIR} \
|
2006-03-02 23:26:12 +08:00
|
|
|
THISDIR=../$(THISDIR) \
|
2002-04-02 14:58:18 +08:00
|
|
|
MAKEDEPEND=Makedepend $(PLUGIN)
|
|
|
|
@$(MAKE) LNSRC=$(OPTDIR)/$(PLUGIN) LNDEST=$(PLUGININST)/$(PLUGIN) __link
|
2005-12-08 19:37:55 +08:00
|
|
|
ifdef IMP_LIB_EXT
|
2006-02-20 23:25:09 +08:00
|
|
|
@$(MAKE) LNSRC=$(OPTDIR)/lib$(TARGET_BASENAME).$(IMP_LIB_EXT) LNDEST=$(IMP_PLUGININST)/lib$(TARGET_BASENAME).$(IMP_LIB_EXT) __link
|
2005-12-08 19:37:55 +08:00
|
|
|
endif
|
2002-04-02 14:58:18 +08:00
|
|
|
|
2005-03-13 09:47:46 +08:00
|
|
|
$(PLUGIN:.$(PLUGIN_EXT)=.static) :
|
|
|
|
@[ -d $(OPTDIR) ] || mkdir -p $(OPTDIR)
|
|
|
|
@cd $(OPTDIR); \
|
|
|
|
$(MAKE) -f ../GNUmakefile DOF=$(OPTF) TOPDIR=../${TOPDIR} \
|
2006-03-02 23:26:12 +08:00
|
|
|
THISDIR=../$(THISDIR) \
|
2005-03-13 09:47:46 +08:00
|
|
|
MAKEDEPEND=Makedepend STATICPLUGIN=$(PLUGIN:.$(PLUGIN_EXT)=.a) $(STATICPLUGIN)
|
|
|
|
@$(MAKE) LNSRC=$(OPTDIR)/$(STATICPLUGIN) LNDEST=$(PLUGININST)/$(STATICPLUGIN) __link
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-03-12 18:39:43 +08:00
|
|
|
## Revamped method for making Makedepend files
|
|
|
|
## Under this method, Makedepend simply includes
|
|
|
|
## all dependency files which are built for each
|
|
|
|
## individual source file. At update, only the individual
|
|
|
|
## dependency file is updated rather than the whole of Makedepend
|
|
|
|
|
|
|
|
Makedepend : $(CXXFILES) $(CFILES)
|
|
|
|
ifeq ($(OS),IRIX)
|
2002-04-02 14:58:18 +08:00
|
|
|
touch $@
|
|
|
|
else
|
2003-03-12 18:39:43 +08:00
|
|
|
@ touch $@
|
|
|
|
@if [ ! -d .depend ] ; then \
|
2006-03-02 23:26:12 +08:00
|
|
|
mkdir .depend; \
|
|
|
|
depfiles="$+"; \
|
|
|
|
else \
|
|
|
|
depfiles="$?"; \
|
|
|
|
fi; \
|
|
|
|
if [ ! -z "$$depfiles" ]; then \
|
2003-03-12 18:39:43 +08:00
|
|
|
for f in $$depfiles; do \
|
|
|
|
echo "$(C++) $(DEPARG) $(INC) $$f pipeto .depend/`basename $$f`"; \
|
|
|
|
$(C++) $(DEPARG) $(INC) $$f > .depend/`basename $$f`; \
|
2006-03-02 23:26:12 +08:00
|
|
|
grep $$f $@ || echo include .depend/`basename $$f` >> Makedepend ; \
|
|
|
|
done; \
|
2003-03-12 18:39:43 +08:00
|
|
|
fi
|
2002-11-07 07:00:37 +08:00
|
|
|
endif
|
2003-03-12 18:39:43 +08:00
|
|
|
|
|
|
|
|
2002-04-02 14:58:18 +08:00
|
|
|
.SUFFIXES: .cpp .o
|
|
|
|
.cpp.o:
|
|
|
|
$(C++) $(CXXFLAGS) -c $<
|
|
|
|
|
|
|
|
depend : $(MAKEDEPEND)
|
|
|
|
|
|
|
|
__link :
|
2003-03-13 14:22:31 +08:00
|
|
|
@sh $(TOPDIR)/Make/dolink.sh $(TOPDIR) $(LNSRC) $(LNDEST) "$(LINK)"
|
2002-04-02 14:58:18 +08:00
|
|
|
|
2002-04-09 22:55:38 +08:00
|
|
|
__instfiles :
|
|
|
|
@echo $(INSTFILES)
|
2002-04-02 14:58:18 +08:00
|
|
|
|
|
|
|
sinclude $(MAKEDEPEND)
|
|
|
|
|