1 # Should be changed to /usr/local
5 libdir=$(prefix)/lib
/cogito
6 sharedir
=$(prefix)/share
/cogito
10 export prefix bindir libdir sharedir INSTALL
13 ### --- END CONFIGURATION SECTION ---
17 SCRIPT
= cg-object-id cg-add cg-admin-uncommit \
18 cg-branch-add cg-branch-ls cg-reset cg-clone cg-commit cg-diff \
19 cg-export cg-help cg-init cg-log cg-merge cg-mkpatch cg-patch \
20 cg-fetch cg-restore cg-rm cg-seek cg-status cg-tag cg-tag-ls cg-update \
21 cg cg-admin-ls cg-push cg-branch-chg cg-admin-cat cg-clean \
22 cg-admin-setuprepo cg-switch cg-mv cg-admin-rewritehist cg-tag-show
24 LIB_SCRIPT
=cg-Xlib cg-Xmergefile cg-Xfetchprogress cg-Xfollowrenames
26 GEN_SCRIPT
= cg-version
30 SHARE_FILES
= default-exclude
43 ifneq (,$(wildcard .git
))
44 GIT_HEAD
=.git
/$(shell git-symbolic-ref HEAD
)
45 GIT_HEAD_ID
=$(shell cg-object-id
-d
)
47 cg-version
: cg-version.in
$(VERSION
) $(GIT_HEAD
)
48 @echo Generating cg-version...
50 @sed
-e
's/@@VERSION@@/$(shell cat $(VERSION))/' \
51 -e
's/@@GIT_HEAD_ID@@/$(GIT_HEAD_ID)/' \
56 $(MAKE
) -C Documentation
all
64 $(MAKE
) -C Documentation
/ test
68 ### Installation rules
70 sedlibdir
=$(shell echo
$(libdir) | sed
's/\//\\\//g')
71 sedsharedir
=$(shell echo
$(sharedir
) | sed
's/\//\\\//g')
73 .PHONY
: install install-cogito install-doc
74 install: install-cogito
76 install-cogito
: $(SCRIPT
) $(LIB_SCRIPT
) $(GEN_SCRIPT
)
77 $(INSTALL
) -m755
-d
$(DESTDIR
)$(bindir)
78 $(INSTALL
) $(SCRIPT
) $(GEN_SCRIPT
) $(DESTDIR
)$(bindir)
79 $(INSTALL
) -m755
-d
$(DESTDIR
)$(libdir)
80 $(INSTALL
) $(LIB_SCRIPT
) $(DESTDIR
)$(libdir)
81 cd
$(DESTDIR
)$(bindir); \
82 for file in
$(SCRIPT
) $(GEN_SCRIPT
); do \
83 sed
-e
's/\$${COGITO_LIB}/\$${COGITO_LIB:-$(sedlibdir)\/}/g' \
84 -e
's/\$${COGITO_SHARE}/\$${COGITO_SHARE:-$(sedsharedir)\/}/g' \
85 $$file > $$file.new
; \
86 cat
$$file.new
> $$file; rm $$file.new
; \
88 cd
$(DESTDIR
)$(libdir); \
89 for file in
$(LIB_SCRIPT
); do \
90 sed
-e
's/\$${COGITO_LIB}/\$${COGITO_LIB:-$(sedlibdir)\/}/g' \
91 -e
's/\$${COGITO_SHARE}/\$${COGITO_SHARE:-$(sedsharedir)\/}/g' \
92 $$file > $$file.new
; \
93 cat
$$file.new
> $$file; rm $$file.new
; \
95 $(INSTALL
) -m755
-d
$(DESTDIR
)$(sharedir
)
96 $(INSTALL
) -m644
$(SHARE_FILES
) $(DESTDIR
)$(sharedir
)
99 $(MAKE
) -C Documentation
install
102 cd
$(DESTDIR
)$(bindir) && rm -f
$(SCRIPT
) $(GEN_SCRIPT
)
103 cd
$(DESTDIR
)$(libdir) && rm -f
$(LIB_SCRIPT
)
104 cd
$(DESTDIR
)$(sharedir
) && rm -f
$(SHARE_FILES
)
108 ### Maintainer's dist rules
110 cogito.spec
: cogito.spec.in
$(VERSION
)
111 sed
-e
's/@@VERSION@@/$(shell cat $(VERSION) | cut -d"-" -f2)/g' < $< > $@
113 GIT_TARNAME
=$(shell cat
$(VERSION
))
115 cg-export
$(GIT_TARNAME
).
tar
116 @mkdir
-p
$(GIT_TARNAME
)
117 @cp cogito.spec
$(GIT_TARNAME
)
118 tar rf
$(GIT_TARNAME
).
tar $(GIT_TARNAME
)/cogito.spec
119 @
rm -rf
$(GIT_TARNAME
)
120 gzip
-f
-9 $(GIT_TARNAME
).
tar
123 rpmbuild
-ta
$(GIT_TARNAME
).
tar.gz
126 tar zxf
$(GIT_TARNAME
).
tar.gz
127 dpkg-source
-b
$(GIT_TARNAME
)
128 cd
$(GIT_TARNAME
) && fakeroot debian
/rules binary \
129 && cd ..
&& rm -rf
$(GIT_TARNAME
)
131 Portfile
: Portfile.in
$(VERSION
) dist
132 sed
-e
's/@@VERSION@@/$(shell cat $(VERSION) | cut -d"-" -f2)/g' < Portfile.in
> Portfile
133 echo
"checksums md5 " `md5sum $(GIT_TARNAME).tar.gz | cut -d ' ' -f 1` >> Portfile
141 rm -f cogito-
*.
tar.gz cogito.spec
142 $(MAKE
) -C Documentation
/ clean