Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow non-opam installations #52

Merged
merged 3 commits into from
May 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ Makeconf
build/
config/
ocaml-freestanding.pc
flags/cflags
flags/cflags.tmp
flags/libs
flags/libs.tmp
33 changes: 19 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,26 @@ ocaml-freestanding.pc: ocaml-freestanding.pc.in Makeconf
-e 's!@@PKG_CONFIG_EXTRA_LIBS@@!$(PKG_CONFIG_EXTRA_LIBS)!' \
ocaml-freestanding.pc.in > $@

flags/libs: flags/libs.tmp Makeconf
sed -e 's!@@PKG_CONFIG_EXTRA_LIBS@@!$(PKG_CONFIG_EXTRA_LIBS)!' \
flags/libs.tmp > flags/libs.tmp2
for PKG in $(PKG_CONFIG_DEPS); do \
echo " " >> flags/libs.tmp2;\
env PKG_CONFIG_PATH=$(shell opam config var prefix)/lib/pkgconfig pkg-config $$PKG --libs >> flags/libs.tmp2;\
done
echo "("`cat flags/libs.tmp2`")" > flags/libs
flags/libs.tmp: flags/libs.tmp.in
opam config subst $@

flags/cflags: flags/cflags.tmp Makeconf
for PKG in $(PKG_CONFIG_DEPS); do \
echo " " >> flags/cflags.tmp;\
env PKG_CONFIG_PATH=$(shell opam config var prefix)/lib/pkgconfig pkg-config $$PKG --cflags >> flags/cflags.tmp;\
done
echo "("`cat flags/cflags.tmp`")" > flags/cflags
flags/libs: flags/libs.tmp Makeconf
env PKG_CONFIG_PATH="$(shell opam config var prefix)/lib/pkgconfig" \
pkg-config $(PKG_CONFIG_DEPS) --libs >> $<
sed -e '1i (' \
-e 's!@@PKG_CONFIG_EXTRA_LIBS@@!$(PKG_CONFIG_EXTRA_LIBS)!' \
-e '$$a )' \
$< > $@

flags/cflags.tmp: flags/cflags.tmp.in
opam config subst $@

flags/cflags: flags/cflags.tmp Makeconf
env PKG_CONFIG_PATH="$(shell opam config var prefix)/lib/pkgconfig" \
pkg-config $(PKG_CONFIG_DEPS) --cflags >> $<
sed -e '1i (' \
-e '$$a )' \
$< > $@

install: all
./install.sh
Expand All @@ -126,3 +129,5 @@ uninstall:

clean:
rm -rf build config Makeconf ocaml-freestanding.pc
rm -rf flags/libs flags/libs.tmp
rm -rf flags/cflags flags/cflags.tmp