Skip to content

Commit

Permalink
Rebuild libcc.so when dependencies change
Browse files Browse the repository at this point in the history
  • Loading branch information
jmjatlanta committed Oct 22, 2021
1 parent d3f7819 commit 62ae1c2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/cc/Makefile_custom
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ RELEASEFLAGS = -O2 -D NDEBUG -combine -fwhole-program
$(info $(OS))
OS := $(shell uname -s)
$(info $(OS))
TARGET = customcc.so
TARGET_DARWIN = customcc.dylib
TARGET_WIN = customcc.dll
TARGET = ../libcc.so
TARGET_DARWIN = ../libcc.dylib
TARGET_WIN = ../libcc.dll
SOURCES = cclib.cpp
#HEADERS = $(shell echo ../cryptoconditions/include/*.h) -I/usr/local/Cellar/gcc\@8/8.3.0/include/c++/8.3.0/

Expand All @@ -22,16 +22,13 @@ $(TARGET): $(SOURCES)
$(info Building cclib to src/)
ifeq ($(OS),Darwin)
$(CC_DARWIN) $(CFLAGS_DARWIN) $(DEBUGFLAGS) -o $(TARGET_DARWIN) -c $(SOURCES)
cp $(TARGET_DARWIN) ../libcc.dylib
else ifeq ($(HOST),x86_64-w64-mingw32)
$(info WINDOWS)
$(CC_WIN) $(CFLAGS_WIN) $(DEBUGFLAGS) -o $(TARGET_WIN) -c $(SOURCES)
cp $(TARGET_WIN) ../libcc.dll
#else ifeq ($(WIN_HOST),True) - todo: pass ENV var from build.sh if WIN host
else
$(info LINUX)
$(CC) $(CFLAGS) $(DEBUGFLAGS) -o $(TARGET) -c $(SOURCES)
cp $(TARGET) ../libcc.so
endif

clean:
Expand Down

3 comments on commit 62ae1c2

@dimxy
Copy link
Collaborator

@dimxy dimxy commented on 62ae1c2 Oct 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay,
I noticed that the libcc is created as a static lib (but given a name with .so, .dll ext) and I temporarily fixed its name as libcc.a in the tokel branch
maybe it is still a static lib in your repo

@jmjatlanta
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will find out if my branch is using it as static or dynamic. Do you know if there a reason to make it a dynamic library?

@dimxy
Copy link
Collaborator

@dimxy dimxy commented on 62ae1c2 Oct 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the initial intention was to make it dynamic to enable cc modules without rebuilding the whole daemon (https://developers.komodoplatform.com/basic-docs/smart-chains/smart-chain-api/cclib.html)
I did a deeper look: seems it is even not a lib but simply an object file (as it is complied with -c option)

Please sign in to comment.