Skip to content

Commit

Permalink
feat: Add operating system detection check in Makefile
Browse files Browse the repository at this point in the history
Added OS detection mechanism to prevent compilation errors when OS is not properly identified.
- Tested in Linux environment.
- Verified error handling works as expected.
  • Loading branch information
mavci42 authored Jan 19, 2025
1 parent 7096b76 commit a2a59c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ ifeq ($(OS),Windows_NT)
COMPILER_SHARED_LIB_DST = compiler.dll
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),)
$(error "Failed to detect operating system")
endif
ifeq ($(UNAME_S),Linux)
SHARED_LIB_SRC = libmovevm.so
SHARED_LIB_DST = libmovevm.$(shell rustc --print cfg | grep target_arch | cut -d '"' -f 2).so
COMPILER_SHARED_LIB_SRC = libcompiler.so
COMPILER_SHARED_LIB_DST = libcompiler.$(shell rustc --print cfg | grep target_arch | cut -d '"' -f 2).so
endif
ifeq ($(UNAME_S),Darwin)
ifeq ($(UNAME_S),Darwin)
SHARED_LIB_SRC = libmovevm.dylib
SHARED_LIB_DST = libmovevm.dylib
COMPILER_SHARED_LIB_SRC = libcompiler.dylib
Expand Down

0 comments on commit a2a59c7

Please sign in to comment.