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
|
|
|
|
2003-03-13 10:53:40 +08:00
|
|
|
opt: $(EXEC:=.opt)\
|
2002-04-02 14:58:18 +08:00
|
|
|
$(LIB:=.opt)\
|
|
|
|
$(PLUGIN:=.opt)\
|
|
|
|
|
2003-03-13 10:53:40 +08:00
|
|
|
debug: $(EXEC:=.dbg)\
|
2002-04-02 14:58:18 +08:00
|
|
|
$(LIB:=.dbg)\
|
|
|
|
$(PLUGIN:=.dbg)\
|
|
|
|
|
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:
|
2002-04-02 14:58:18 +08:00
|
|
|
@[ -d $(OPTDIR) ] && cd $(OPTDIR); rm -f $(EXEC) $(LIB) $(PLUGIN)
|
|
|
|
|
2003-03-13 10:53:40 +08:00
|
|
|
cleantargetdbg:
|
2002-04-02 14:58:18 +08:00
|
|
|
@[ -d $(DEBUGDIR) ] && cd $(DEBUGDIR); rm -f $(EXEC) $(LIB) $(PLUGIN)
|
|
|
|
|
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)/* && \
|
|
|
|
echo "$(TARGET_BASENAME) HTML documentation created in "\
|
|
|
|
"$(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
|
|
|
|
2003-03-13 10:53:40 +08:00
|
|
|
$(PLUGIN): $(OBJS)
|
2002-04-02 14:58:18 +08:00
|
|
|
$(C++) $(LDFLAGS) -bundle $(OBJS) $(LIBS) -o $@
|
|
|
|
else
|
2002-07-23 18:48:22 +08:00
|
|
|
ifeq ($(OS),HP-UX)
|
|
|
|
# we need to explicitly tell the linker the library name - else it will
|
|
|
|
# include paths like ../../../libosg.sl into executables
|
|
|
|
$(LIB) $(PLUGIN) : $(OBJS)
|
2002-07-23 23:01:51 +08:00
|
|
|
$(C++) $(LDFLAGS) $(SHARED) $(OBJS) $(LIBS) -Wl,+h -Wl,$@ -o $@
|
2002-07-23 18:48:22 +08:00
|
|
|
else
|
2002-04-02 14:58:18 +08:00
|
|
|
$(LIB) $(PLUGIN) : $(OBJS)
|
|
|
|
$(C++) $(LDFLAGS) $(SHARED) $(OBJS) $(LIBS) -o $@
|
|
|
|
|
2002-07-23 18:48:22 +08:00
|
|
|
endif # not HP-UX
|
|
|
|
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} \
|
2002-04-04 01:42:12 +08:00
|
|
|
THISDIR=../$(THISDIR)\
|
|
|
|
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
|
|
|
|
2002-11-27 13:29:59 +08:00
|
|
|
$(LIB:=.dbg) : $(PLUGIN:=.dbg)
|
2002-04-02 14:58:18 +08:00
|
|
|
@[ -d $(DEBUGDIR) ] || mkdir $(DEBUGDIR)
|
2002-04-04 01:42:12 +08:00
|
|
|
@cd $(DEBUGDIR);\
|
2003-03-12 18:39:43 +08:00
|
|
|
$(MAKE) -f ../GNUmakefile "DOF=$(DBGF)" TOPDIR=../${TOPDIR} \
|
2002-04-04 01:42:12 +08:00
|
|
|
THISDIR=../$(THISDIR)\
|
|
|
|
MAKEDEPEND=Makedepend $(LIB)
|
2004-08-29 07:04:47 +08:00
|
|
|
@$(MAKE) LNSRC=$(DEBUGDIR)/$(LIB) LNDEST=$(LIBINST)/$(LIB) __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} \
|
2002-04-04 01:42:12 +08:00
|
|
|
THISDIR=../$(THISDIR)\
|
|
|
|
MAKEDEPEND=Makedepend $(PLUGIN)
|
2002-04-02 14:58:18 +08:00
|
|
|
@$(MAKE) LNSRC=$(DEBUGDIR)/$(PLUGIN) LNDEST=$(PLUGININST)/$(PLUGIN) __link
|
|
|
|
|
|
|
|
$(EXEC:=.opt) :
|
|
|
|
@[ -d $(OPTDIR) ] || mkdir $(OPTDIR)
|
|
|
|
@cd $(OPTDIR); \
|
2003-03-12 18:39:43 +08:00
|
|
|
$(MAKE) -f ../GNUmakefile DOF=$(OPTF) TOPDIR=../${TOPDIR} \
|
2002-04-04 01:42:12 +08:00
|
|
|
THISDIR=../$(THISDIR)\
|
|
|
|
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)
|
2002-04-04 01:42:12 +08:00
|
|
|
@cd $(OPTDIR);\
|
2003-03-12 18:39:43 +08:00
|
|
|
$(MAKE) -f ../GNUmakefile DOF=$(OPTF) TOPDIR=../${TOPDIR} \
|
2002-04-04 01:42:12 +08:00
|
|
|
THISDIR=../$(THISDIR)\
|
|
|
|
MAKEDEPEND=Makedepend $(LIB)
|
2004-08-29 07:04:47 +08:00
|
|
|
@$(MAKE) LNSRC=$(OPTDIR)/$(LIB) LNDEST=$(LIBINST)/$(LIB) __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} \
|
2002-04-02 14:58:18 +08:00
|
|
|
THISDIR=../$(THISDIR)\
|
|
|
|
MAKEDEPEND=Makedepend $(PLUGIN)
|
|
|
|
@$(MAKE) LNSRC=$(OPTDIR)/$(PLUGIN) LNDEST=$(PLUGININST)/$(PLUGIN) __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 \
|
|
|
|
mkdir .depend;\
|
|
|
|
depfiles="$+";\
|
|
|
|
else\
|
|
|
|
depfiles="$?";\
|
|
|
|
fi;\
|
|
|
|
if [ ! -z "$$depfiles" ]; then\
|
|
|
|
for f in $$depfiles; do \
|
|
|
|
echo "$(C++) $(DEPARG) $(INC) $$f pipeto .depend/`basename $$f`"; \
|
|
|
|
$(C++) $(DEPARG) $(INC) $$f > .depend/`basename $$f`; \
|
|
|
|
grep $$f $@ || echo include .depend/`basename $$f` >> Makedepend ;\
|
|
|
|
done;\
|
|
|
|
fi
|
2002-11-07 07:00:37 +08:00
|
|
|
endif
|
2003-03-12 18:39:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
ifeq (0,1) ##### OLD WAY : Keep until we've proven that this doesn't trip up
|
|
|
|
##### on other OS's.
|
|
|
|
Makedepend : $(CXXFILES) $(CFILES)
|
|
|
|
ifeq ($(OS),IRIX)
|
|
|
|
touch $@
|
|
|
|
else
|
|
|
|
$(C++) $(INC) $(DEPARG) $^ > $(MAKEDEPEND)
|
|
|
|
endif
|
|
|
|
|
2002-04-02 14:58:18 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
.SUFFIXES: .cpp .o
|
|
|
|
.cpp.o:
|
|
|
|
$(C++) $(CXXFLAGS) -c $<
|
|
|
|
|
|
|
|
depend : $(MAKEDEPEND)
|
|
|
|
|
|
|
|
__link :
|
2004-10-26 04:08:06 +08:00
|
|
|
@echo Calling dolink.sh wit LNSRC = $(LNSRC) and LNDEST = $(LNDEST)
|
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)
|
|
|
|
|