Skip to content

Commit

Permalink
[ make ] install .so file in correct location (#68)
Browse files Browse the repository at this point in the history
* [ make ] install .so file in correct location

* [ lint ] use tabs in Makefile
  • Loading branch information
stefan-hoeck authored Oct 2, 2024
1 parent ab06f53 commit 7965b0f
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions chem-inchi/support/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@ TARGET = idris2_inchi
TARGET_VERSION ?= 0.0.1

INSTALLDIR = ../lib
INSTALLDIR2 = ../../lib

LDFLAGS = -linchi
CPPFLAGS =

CC_VERSION = $(shell $(CC) --version)

ifeq ($(findstring clang,$(CC_VERSION)),clang)
DYLIB_WORKAROUND = cp "${INSTALLDIR}/${TARGET}" "${INSTALLDIR}/${TARGET}.dylib"
DYLIB_WORKAROUND = cp "${INSTALLDIR2}/${TARGET}" "${INSTALLDIR2}/${TARGET}.dylib"
DYLIB_WORKAROUND = cp "${INSTALLDIR}/${TARGET}" "${INSTALLDIR}/${TARGET}.dylib"
else
DYLIB_WORKAROUND = cp "${INSTALLDIR}/${TARGET}" "${INSTALLDIR}/${TARGET}.so"
DYLIB_WORKAROUND = cp "${INSTALLDIR2}/${TARGET}" "${INSTALLDIR2}/${TARGET}.so"
LDFLAGS += -fuse-ld=gold
DYLIB_WORKAROUND = cp "${INSTALLDIR}/${TARGET}" "${INSTALLDIR}/${TARGET}.so"
LDFLAGS += -fuse-ld=gold
endif

SRCS = $(wildcard *.c)
Expand All @@ -31,13 +28,10 @@ $(TARGET): $(OBJS)
clean :
rm -f $(OBJS) $(TARGET)
rm -rf $(INSTALLDIR)
rm -rf $(INSTALLDIR2)

.PHONY: install

install:
mkdir -p $(INSTALLDIR)
mkdir -p $(INSTALLDIR2)
install $(TARGET) $(wildcard *.h) $(INSTALLDIR)
install $(TARGET) $(wildcard *.h) $(INSTALLDIR2)
$(DYLIB_WORKAROUND)

0 comments on commit 7965b0f

Please sign in to comment.