Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
prefix=/usr/local
prefix=/usr
Comment thread
KP2048 marked this conversation as resolved.
Outdated
bindir=$(prefix)/bin
datadir=$(prefix)/share

Expand Down Expand Up @@ -43,7 +43,7 @@ motor: $(OBJS)
$(CXX) -o motor $^ $(LDFLAGS) $(LIBS)

%.o: %.cc
$(CXX) -DSHARE_DIR=\"$(datadir)/motor\" $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
$(CXX) -DSHARE_DIR="\"$(datadir)/motor\"" $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
Comment thread
KP2048 marked this conversation as resolved.
Outdated

%.o: %.c
$(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
Expand Down
174 changes: 174 additions & 0 deletions Makefile.func
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
#
# Motor IDE functional Makefile template
# for terminal program in C++
#
# Written by Konstantin Klyagin <konst@konst.org.ua>
# Distributed under the GNU Public License

# Project settings and files

SOURCES = parser/src/llist.c parser/src/parser_cgi.c parser/src/parlist.c parser/src/strfn.c parser/src/parser.c kksystr/src/kkiproc.cc kksystr/src/kkfsys.cc src/configuration/motorconfiguration.cc src/configuration/extkey.cc src/motormisc.cc src/tagbrowser/motortagbrowser.cc src/project/projectdesk.cc src/project/projecttempl.cc src/project/projectname.cc src/project/projectfiles.cc src/project/projecttake.cc src/project/sourcetemplate.cc src/project/motorfolder.cc src/project/projectpaths.cc src/project/motordist.cc src/project/motorproject.cc src/project/projectdebug.cc src/project/motorfile.cc src/debugger/debuggermessage.cc src/debugger/motordebugger.cc src/debugger/watch.cc src/debugger/breakpoint.cc src/debugger/stackitem.cc src/debugger/debuggercommand.cc src/manager/motormanager.cc src/executor/parserule.cc src/executor/motorexecutor.cc src/grepper/motorgrepper.cc src/vcs/motorvcs.cc src/main.cc src/ui/motorui.cc src/ui/ncurses/uieditor.cc src/ui/ncurses/uiwatcher.cc src/ui/ncurses/uitagbrowser.cc src/ui/ncurses/uiconfiguration.cc src/ui/ncurses/uigrepper.cc src/ui/ncurses/uivcs.cc src/ui/ncurses/uiregexper.cc src/ui/ncurses/ncursesui.cc kkstrtext/kkstrtext.cc kkconsui/src/screenarea.cc kkconsui/src/textbrowser.cc kkconsui/src/texteditor.cc kkconsui/src/horizontalbar.cc kkconsui/src/linkedlist.cc kkconsui/src/textinputline.cc kkconsui/src/dialogbox.cc kkconsui/src/fileselector.cc kkconsui/src/cmenus.cc kkconsui/src/treeview.cc kkconsui/src/textwindow.cc kkconsui/src/conscommon.cc kkconsui/src/abstractui.cc
HEADERS = parser/include/llist.h parser/include/parser_cgi.h parser/include/parlist.h parser/include/parser.h parser/include/strfn.h kksystr/include/kkiproc.h kksystr/include/kkfsys.h kksystr/include/conf.h src/configuration/motorconfiguration.h src/tagbrowser/motortagbrowser.h src/project/motorfile.h src/project/projectdesk.h src/project/motorfolder.h src/project/projectfiles.h src/project/motordist.h src/project/projectpaths.h src/project/projecttempl.h src/project/motorproject.h src/project/projectname.h src/project/sourcetemplate.h src/project/projecttake.h src/project/projectdebug.h src/motorcommon.h src/debugger/motordebugger.h src/debugger/stackitem.h src/debugger/watch.h src/debugger/debuggercommand.h src/debugger/breakpoint.h src/debugger/debuggermessage.h src/motormisc.h src/manager/motormanager.h src/executor/motorexecutor.h src/executor/parserule.h src/grepper/motorgrepper.h src/vcs/motorvcs.h src/ui/ncurses/uivcs.h src/ui/ncurses/uidefs.h src/ui/ncurses/uiconfiguration.h src/ui/ncurses/uiregexper.h src/ui/ncurses/uigrepper.h src/ui/ncurses/uitagbrowser.h src/ui/ncurses/uieditor.h src/ui/ncurses/ncursesui.h src/ui/ncurses/uiwatcher.h src/ui/motorui.h kkstrtext/conf.h kkstrtext/kkstrtext.h kkconsui/include/dialogbox.h kkconsui/include/linkedlist.h kkconsui/include/texteditor.h kkconsui/include/conf.h kkconsui/include/fileselector.h kkconsui/include/conscommon.h kkconsui/include/screenarea.h kkconsui/include/treeview.h kkconsui/include/abstractui.h kkconsui/include/textwindow.h kkconsui/include/textinputline.h kkconsui/include/cmenus.h kkconsui/include/textbrowser.h kkconsui/include/horizontalbar.h
DOCS = AUTHORS ChangeLog parser/AUTHORS parser/ChangeLog parser/TODO parser/INSTALL parser/COPYING parser/README NEWS TODO INSTALL tutorial/more.html tutorial/index.html tutorial/advanced.html tutorial/intro.html po/ChangeLog COPYING FAQ ABOUT-NLS README
MISCF = share/themes share/CVS.vcsrc share/external share/syntax share/templates/terminal program/perl/Folders share/templates/terminal program/perl/configure.in.tmpl share/templates/terminal program/perl/[value name].pl.tmpl share/templates/terminal program/perl/[value name].spec.tmpl share/templates/terminal program/perl/Settings share/templates/terminal program/perl/Parserules share/templates/terminal program/perl/Debug share/templates/terminal program/C++/Folders share/templates/terminal program/C++/configure.in.tmpl share/templates/terminal program/C++/[value name].spec.tmpl share/templates/terminal program/C++/Settings share/templates/terminal program/C++/[value name].cc.tmpl share/templates/terminal program/C++/Parserules share/templates/terminal program/C++/Debug share/templates/terminal program/C/Folders share/templates/terminal program/C/configure.in.tmpl share/templates/terminal program/C/[value name].c.tmpl share/templates/terminal program/C/[value name].spec.tmpl share/templates/terminal program/C/Settings share/templates/terminal program/C/Parserules share/templates/terminal program/C/Debug share/templates/terminal program/java/[value name].java.tmpl share/templates/terminal program/java/Folders share/templates/terminal program/java/configure.in.tmpl share/templates/terminal program/java/[value name].spec.tmpl share/templates/terminal program/java/Settings share/templates/terminal program/java/Parserules share/templates/terminal program/java/Debug share/templates/library/static/Folders share/templates/library/static/configure.in.tmpl share/templates/library/static/[value name].spec.tmpl share/templates/library/static/Settings share/templates/library/static/Parserules share/templates/library/static/Debug misc/motorsync tutorial/images/snapshot02.png tutorial/images/snapshot01.png tutorial/images/snapshot09.png tutorial/images/snapshot10.png tutorial/images/snapshot04.png tutorial/images/snapshot08.png tutorial/images/snapshot06.png tutorial/images/snapshot05.png tutorial/images/snapshot03.png tutorial/images/konstsm.jpg tutorial/images/motor-mw.gif tutorial/images/snapshot11.png tutorial/images/snapshot07.png motor.1 po/quot.sed po/insert-header.sin po/pl.po po/ru.po po/en@boldquot.header po/remove-potcdate.sin po/de.po po/en@quot.header po/boldquot.sed po/Rules-quot po/zh_CN.po po/Makevars motor motor.motor
BUILDF = Makefile motor.spec
ALL_FILES := $(strip $(SOURCES) $(HEADERS) $(MISCF) $(DOCS))
ALL_DIRS := $(sort $(dir $(ALL_FILES)))
PROJNAME = motor
PROJVER = 0.1
INCLDIRS =
PROG = motor
DIST_TARGZ := $(PROJNAME)-$(PROJVER).tar.gz
LDFLAGS =
CLNAMES =
WANT_AM = WANT_AUTOCONF=2.1 WANT_AUTOMAKE=1.4
WANT = $(WANT_AM) CFLAGS="-O0 -g" CXXFLAGS="-O0 -g"

# Motor specific targets

# Executed every time there is a need to compile the stuff

build: ready
$(WANT) $(MAKE)

# Executed to make sure the build environment is ready

ready:

# Invoked for cleaning up

clean: ready
$(MAKE) clean

# This one starts the debugger

debug:
@prg=`echo "$(PROG)" | sed 's/-/_/g'`; prg=`find . -name "$${prg}"`; \
exec gdb --fullname -silent -tty `cat .debugtty && rm -f .debugtty` $${prg}

# Runs the program

run:
@prg=`echo "$(PROG)" | sed 's/-/_/g'`; \
CMD="`find . -name "$${prg}" -type f`"; \
`echo $$CMD`

# Executed on project creation

start: makesure

# Executed on project modification

update:

#
# Add connected libs into the distribution package
#

distextra:
@sed 's|^EXTRA_DIST\(.*\)$$|EXTRA_DIST\1 $(addsuffix /*, $(CLNAMES))|g' Makefile.am >.makefile.am; \
mv .makefile.am Makefile.am

#
# Modify the Makefile.am thus connected libraries are to compile
# don't forget to replace dirs in -L and -I
#

linklibs:

distlib: linklibs
@echo; \
if test ! -z "$$rsed"; then \
for file in `find . -name Makefile.am`; do \
sed "$$rsed" $$file >.makefile.am; \
mv .makefile.am $$file; \
done; \
fi
@echo -e "dist-hook:\n\tcd \$$(top_distdir); subs=\`egrep \"^[:space:]*SUBDIRS\" Makefile.am | sed 's/SUBDIRS[ =]\+//g'\`; \\" >.makefile.am
@echo -e "\techo \"SUBDIRS = $(CLNAMES) \$$\$$subs\" >>.makefile.am; \\" >>.makefile.am
@echo -e "\tegrep -v \"^[:space:]*SUBDIRS\" Makefile.am >>.makefile.am; \\" >>.makefile.am
@echo -e "\tmv .makefile.am Makefile.am; $(WANT_AM) autoconf && automake" >>.makefile.am
@echo -e "\n# END OF MOTOR DIST TARGETS #" >>.makefile.am
@cat Makefile.am >>.makefile.am
@mv .makefile.am Makefile.am
@cat configure.in | egrep -v "^[[:space:]]*AC_OUTPUT|^[[:space:]]*AC_CONFIG_SUBDIRS" >.configure.in; \
libdirs="$(CLNAMES)"; \
if test -n "$$libdirs"; then \
libdirs=`echo $$libdirs | sed 's/^\s+|\s+$$//g'`; \
echo "AC_CONFIG_SUBDIRS($$libdirs)" >>.configure.in; \
fi; \
cat configure.in | egrep "^[[:space:]]*AC_OUTPUT" >>.configure.in; \
mv .configure.in configure.in; \

dist:
$(MAKE) dist
$(MAKE) -f Makefile.func automake

distcleanup:
@if test -f Makefile.am; then \
cat Makefile.am | perl -e \
"while(<STDIN>) { \
chomp; push (@toshow, \$$_); \
@toshow = () if \$$_ eq '# END OF MOTOR DIST TARGETS #'; \
}; \
print map { \$$_, \"\n\" } @toshow;" \
>.makefile.am; \
mv .makefile.am Makefile.am; \
fi

rpmspec:
@if test ! -f motor.spec; then \
echo "motor.spec file not found!"; \
exit 1; \
fi
@sed "s/^[[:space:]]*Version\: .*$$/Version: $(PROJVER)/g" <motor.spec >motor.spec.uver
@if test -z "`egrep '^[[:space:]]*BuildRoot: ' motor.spec`"; then \
echo "BuildRoot: /var/tmp/%{name}-buildroot" >motor.spec; \
cat motor.spec.uver >>motor.spec; \
else \
mv motor.spec.uver motor.spec; \
fi
@rm -f mv motor.spec.uver

rpm: rpmspec dist
@if test ! -f ~/.motor/rpmrc; then \
echo "macrofiles: /usr/lib/rpm/macros:/usr/lib/rpm/%{_target}/macros:/etc/rpm/macros.specspo:/etc/rpm/macros:/etc/rpm/%{_target}/macros:~/.rpmmacros:~/.motor/rpmmacros" >~/.motor/rpmrc; \
fi
@if test ! -f ~/.motor/rpmmacros; then \
echo "%_topdir $${HOME}/.motor/rpm" >>~/.motor/rpmmacros; \
echo "%_builddir %{_topdir}/BUILD" >>~/.motor/rpmmacros; \
echo "%_rpmdir %{_topdir}/RPMS" >>~/.motor/rpmmacros; \
echo "%_sourcedir %{_topdir}/SOURCES" >>~/.motor/rpmmacros; \
echo "%_specdir %{_topdir}/SPECS" >>~/.motor/rpmmacros; \
echo "%_srcrpmdir %{_topdir}/SRPMS" >>~/.motor/rpmmacros; \
echo "%_tmppath %{_var}/tmp" >>~/.motor/rpmmacros; \
fi
@-for i in SPECS BUILD RPMS SRPMS; do mkdir -p "$${HOME}/.motor/rpm/$$i"; done
unset LINGUAS; rpmbuild -ta --rcfile ~/.motor/rpmrc --target i386-pc-linux-gnu /$(DIST_TARGZ)
find "${HOME}/.motor/rpm" -name "$(PROJNAME)-$(PROJVER)*rpm" -exec mv {} "" \;
rm -rf "${HOME}/.motor/rpm"


makesure:
@for i in $(ALL_FILES) $(BUILDF); do \
if test ! -f $$i; then touch $$i; fi; \
done

tags:
@if test "$$MOTOR_TAGS" = "file"; then \
TFILES="$$MOTOR_CURRENTFILE"; \
elif test "$$MOTOR_TAGS" = "project"; then \
TFILES=" parser/src/llist.c parser/src/parser_cgi.c parser/src/parlist.c parser/src/strfn.c parser/src/parser.c kksystr/src/kkiproc.cc kksystr/src/kkfsys.cc src/configuration/motorconfiguration.cc src/configuration/extkey.cc src/motormisc.cc src/tagbrowser/motortagbrowser.cc src/project/projectdesk.cc src/project/projecttempl.cc src/project/projectname.cc src/project/projectfiles.cc src/project/projecttake.cc src/project/sourcetemplate.cc src/project/motorfolder.cc src/project/projectpaths.cc src/project/motordist.cc src/project/motorproject.cc src/project/projectdebug.cc src/project/motorfile.cc src/debugger/debuggermessage.cc src/debugger/motordebugger.cc src/debugger/watch.cc src/debugger/breakpoint.cc src/debugger/stackitem.cc src/debugger/debuggercommand.cc src/manager/motormanager.cc src/executor/parserule.cc src/executor/motorexecutor.cc src/grepper/motorgrepper.cc src/vcs/motorvcs.cc src/main.cc src/ui/motorui.cc src/ui/ncurses/uieditor.cc src/ui/ncurses/uiwatcher.cc src/ui/ncurses/uitagbrowser.cc src/ui/ncurses/uiconfiguration.cc src/ui/ncurses/uigrepper.cc src/ui/ncurses/uivcs.cc src/ui/ncurses/uiregexper.cc src/ui/ncurses/ncursesui.cc kkstrtext/kkstrtext.cc kkconsui/src/screenarea.cc kkconsui/src/textbrowser.cc kkconsui/src/texteditor.cc kkconsui/src/horizontalbar.cc kkconsui/src/linkedlist.cc kkconsui/src/textinputline.cc kkconsui/src/dialogbox.cc kkconsui/src/fileselector.cc kkconsui/src/cmenus.cc kkconsui/src/treeview.cc kkconsui/src/textwindow.cc kkconsui/src/conscommon.cc kkconsui/src/abstractui.cc parser/include/llist.h parser/include/parser_cgi.h parser/include/parlist.h parser/include/parser.h parser/include/strfn.h kksystr/include/kkiproc.h kksystr/include/kkfsys.h kksystr/include/conf.h src/configuration/motorconfiguration.h src/tagbrowser/motortagbrowser.h src/project/motorfile.h src/project/projectdesk.h src/project/motorfolder.h src/project/projectfiles.h src/project/motordist.h src/project/projectpaths.h src/project/projecttempl.h src/project/motorproject.h src/project/projectname.h src/project/sourcetemplate.h src/project/projecttake.h src/project/projectdebug.h src/motorcommon.h src/debugger/motordebugger.h src/debugger/stackitem.h src/debugger/watch.h src/debugger/debuggercommand.h src/debugger/breakpoint.h src/debugger/debuggermessage.h src/motormisc.h src/manager/motormanager.h src/executor/motorexecutor.h src/executor/parserule.h src/grepper/motorgrepper.h src/vcs/motorvcs.h src/ui/ncurses/uivcs.h src/ui/ncurses/uidefs.h src/ui/ncurses/uiconfiguration.h src/ui/ncurses/uiregexper.h src/ui/ncurses/uigrepper.h src/ui/ncurses/uitagbrowser.h src/ui/ncurses/uieditor.h src/ui/ncurses/ncursesui.h src/ui/ncurses/uiwatcher.h src/ui/motorui.h kkstrtext/conf.h kkstrtext/kkstrtext.h kkconsui/include/dialogbox.h kkconsui/include/linkedlist.h kkconsui/include/texteditor.h kkconsui/include/conf.h kkconsui/include/fileselector.h kkconsui/include/conscommon.h kkconsui/include/screenarea.h kkconsui/include/treeview.h kkconsui/include/abstractui.h kkconsui/include/textwindow.h kkconsui/include/textinputline.h kkconsui/include/cmenus.h kkconsui/include/textbrowser.h kkconsui/include/horizontalbar.h"; \
elif test "$$MOTOR_TAGS" = "all"; then \
TFILES=" parser/src/llist.c parser/src/parser_cgi.c parser/src/parlist.c parser/src/strfn.c parser/src/parser.c kksystr/src/kkiproc.cc kksystr/src/kkfsys.cc src/configuration/motorconfiguration.cc src/configuration/extkey.cc src/motormisc.cc src/tagbrowser/motortagbrowser.cc src/project/projectdesk.cc src/project/projecttempl.cc src/project/projectname.cc src/project/projectfiles.cc src/project/projecttake.cc src/project/sourcetemplate.cc src/project/motorfolder.cc src/project/projectpaths.cc src/project/motordist.cc src/project/motorproject.cc src/project/projectdebug.cc src/project/motorfile.cc src/debugger/debuggermessage.cc src/debugger/motordebugger.cc src/debugger/watch.cc src/debugger/breakpoint.cc src/debugger/stackitem.cc src/debugger/debuggercommand.cc src/manager/motormanager.cc src/executor/parserule.cc src/executor/motorexecutor.cc src/grepper/motorgrepper.cc src/vcs/motorvcs.cc src/main.cc src/ui/motorui.cc src/ui/ncurses/uieditor.cc src/ui/ncurses/uiwatcher.cc src/ui/ncurses/uitagbrowser.cc src/ui/ncurses/uiconfiguration.cc src/ui/ncurses/uigrepper.cc src/ui/ncurses/uivcs.cc src/ui/ncurses/uiregexper.cc src/ui/ncurses/ncursesui.cc kkstrtext/kkstrtext.cc kkconsui/src/screenarea.cc kkconsui/src/textbrowser.cc kkconsui/src/texteditor.cc kkconsui/src/horizontalbar.cc kkconsui/src/linkedlist.cc kkconsui/src/textinputline.cc kkconsui/src/dialogbox.cc kkconsui/src/fileselector.cc kkconsui/src/cmenus.cc kkconsui/src/treeview.cc kkconsui/src/textwindow.cc kkconsui/src/conscommon.cc kkconsui/src/abstractui.cc parser/include/llist.h parser/include/parser_cgi.h parser/include/parlist.h parser/include/parser.h parser/include/strfn.h kksystr/include/kkiproc.h kksystr/include/kkfsys.h kksystr/include/conf.h src/configuration/motorconfiguration.h src/tagbrowser/motortagbrowser.h src/project/motorfile.h src/project/projectdesk.h src/project/motorfolder.h src/project/projectfiles.h src/project/motordist.h src/project/projectpaths.h src/project/projecttempl.h src/project/motorproject.h src/project/projectname.h src/project/sourcetemplate.h src/project/projecttake.h src/project/projectdebug.h src/motorcommon.h src/debugger/motordebugger.h src/debugger/stackitem.h src/debugger/watch.h src/debugger/debuggercommand.h src/debugger/breakpoint.h src/debugger/debuggermessage.h src/motormisc.h src/manager/motormanager.h src/executor/motorexecutor.h src/executor/parserule.h src/grepper/motorgrepper.h src/vcs/motorvcs.h src/ui/ncurses/uivcs.h src/ui/ncurses/uidefs.h src/ui/ncurses/uiconfiguration.h src/ui/ncurses/uiregexper.h src/ui/ncurses/uigrepper.h src/ui/ncurses/uitagbrowser.h src/ui/ncurses/uieditor.h src/ui/ncurses/ncursesui.h src/ui/ncurses/uiwatcher.h src/ui/motorui.h kkstrtext/conf.h kkstrtext/kkstrtext.h kkconsui/include/dialogbox.h kkconsui/include/linkedlist.h kkconsui/include/texteditor.h kkconsui/include/conf.h kkconsui/include/fileselector.h kkconsui/include/conscommon.h kkconsui/include/screenarea.h kkconsui/include/treeview.h kkconsui/include/abstractui.h kkconsui/include/textwindow.h kkconsui/include/textinputline.h kkconsui/include/cmenus.h kkconsui/include/textbrowser.h kkconsui/include/horizontalbar.h"; \
fi; \
if test ! -z "$$TFILES"; then ctags --c++-types=cdefgmnpstuvx --excmd=number -f - $$TFILES; fi

target: ready
@$(WANT) $(MAKE) ${MOTOR_TARGET}

gnudoc:
touch INSTALL NEWS README COPYING AUTHORS ChangeLog

.PHONY: build update debug automake dist rpm start makesure distextra \
distlib gettext target linklibs gnudoc
Empty file added NEWS
Empty file.
Loading