Skip to content

Commit

Permalink
Fixed make file for MACOS compilation
Browse files Browse the repository at this point in the history
Fixed cpui.c to include correct headers files
  • Loading branch information
J. Marcelo Aviles Paco authored and J. Marcelo Aviles Paco committed Mar 9, 2022
1 parent a428d5e commit 8fea02f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
34 changes: 25 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,51 @@ VFLAGS=-X -DGETTEXT_PACKAGE
VLIBS=--pkg gmodule-2.0\
--pkg mysql\
--pkg sqlite3\
--pkg gee-1.0\
--pkg gee-0.8\
--pkg gio-2.0\
--pkg posix\
--pkg libxml-2.0\
--pkg json-glib-1.0

CLIBS=`pkg-config gio-2.0 --libs`\
-lgmodule-2.0\
-ljson-glib-1.0\
-lxml2\
-lgee\
-lsqlite3\
-lmysqlclient
`pkg-config gmodule-2.0 --libs`\
`pkg-config json-glib-1.0 --libs`\
`pkg-config libxml-2.0 --libs`\
`pkg-config gee-0.8 --libs`\
`pkg-config sqlite3 --libs`\
`pkg-config mysqlclient --libs`
#-lintl

VC=valac
MACROS=-D __linux__
SOURCES=$(wildcard classes/*.vala) $(wildcard Database/*.vala)

$(info Trying to detect the operating system)
ifneq (, $(findstring /Library, $(PATH)))
OS=LINUX
DEST_LIBRARY=libSinticBolivia.dylib
$(info MACOS detected)
else ifneq (, $(findstring /usr/bin, $(PATH)))
OS=MACOS
DEST_LIBRARY=libSinticBolivia.so
$(info LINUX detected)
else ifneq (, $(findstring Windows, $(PATH)))
OS=WINDOWS_NT
DEST_LIBRARY=libSinticBolivia.dll
$(info Windows detected)
endif


LIBRARY_NAME=SinticBolivia
#include Database/Makefile

all: $(SOURCES) $(DEST_LIBRARY)

$(DEST_LIBRARY): $(SOURCES)
@#$(VC) $(MACROS) $(VFLAGS) $(VLIBS) --library=$(LIBRARY_NAME) -H $(LIBRARY_NAME).h $(SOURCES) -X -fPIC -X -shared -o bin/$@
$(VC) -c $(MACROS) $(VFLAGS) $(VLIBS) --library=$(LIBRARY_NAME) -H $(LIBRARY_NAME).h $(SOURCES) -X -fPIC
$(VC) -c $(MACROS) $(VFLAGS) $(VLIBS) --library=$(LIBRARY_NAME) -H $(LIBRARY_NAME).h $(SOURCES) -X -fPIC -X -I.
gcc -c ccode/cpuid.c -fPIC
gcc -o bin/$@ *.o $(CLIBS) -shared
gcc -o $@ *.o $(CLIBS) -shared


#$(OBJECTS): $(SOURCES)
Expand Down
1 change: 1 addition & 0 deletions ccode/cpuid.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <stdlib.h>
#include <stdio.h>
//#ifdef __PIC__
// #define do_cpuid(func, eax, ebx, ecx, edx) __asm__ __volatile__ ("cpuid": "=a" (varEAX), "=b" (varEBX), "=c" (varECX), "=d" (varEDX) : "a" (1));
Expand Down

0 comments on commit 8fea02f

Please # to comment.