Skip to content

Commit

Permalink
updated build system for silicon.h
Browse files Browse the repository at this point in the history
  • Loading branch information
ColleagueRiley committed Oct 22, 2023
1 parent f9365c1 commit 1fb8487
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,5 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: silicon-binaries
run: git clone https://github.com/ColleagueRiley/Silicon -b binaries && cp Silicon/ARM/*.o deps/Silicon/source
- name: make
run: make
14 changes: 4 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,21 @@ else
endif

ifeq ($(detected_OS),Windows)
LIBS := -lopengl32 -lshell32 -lgdi32 -lm
LIBS := -lopengl32 -lshell32 -lgdi32
EXT = dll
endif
ifeq ($(detected_OS),Darwin) # Mac OS X
LIBS := ./deps/Silicon/source/*.o -lm -framework Foundation -framework AppKit -framework OpenGL -framework CoreVideo
LIBS := -framework Foundation -framework AppKit -framework OpenGL -framework CoreVideo
EXT = dylib
endif
ifeq ($(detected_OS),Linux)
LIBS := -I./include -lX11 -lGLX -lm
LIBS := -lX11 -lGLX
EXT = so
endif

all:
@if [ $(shell uname) = Darwin ]; then\
make deps/Silicon/source/mac.o;\
fi
make RSGL.o
gcc RSGL.o -shared -O3 -I./include $(LIBS) -o libRSGL.$(EXT)
gcc RSGL.o -shared -O3 $(LIBS) -lm -o libRSGL.$(EXT)
ar rcs libRSGL.a *.o

RSGL.o:
Expand All @@ -36,9 +33,6 @@ RSGL.o:
clean:
rm libRSGL.so RSGL.o libRSGL.a

deps/Silicon/source/mac.o:
cd deps/Silicon/source/ && gcc -c *.m -I../

install:
sudo cp libRSGL.so /usr/lib
sudo cp libRSGL.a /usr/local/lib
Expand Down

0 comments on commit 1fb8487

Please sign in to comment.