mirror of
https://notabug.org/scuti/lib3ddevil1
synced 2024-11-29 02:02:04 +05:30
Makefile creates .so (internall a .dll on windows?)
This commit is contained in:
parent
d888298afd
commit
3f76eddbce
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,9 +1,10 @@
|
|||||||
# Files from compilation and tests
|
# Files from compilation and tests
|
||||||
*.o
|
*.o
|
||||||
|
*.so
|
||||||
|
*.gch
|
||||||
*.exe
|
*.exe
|
||||||
*.stackdump
|
*.stackdump
|
||||||
*.log
|
*.log
|
||||||
devil1test
|
|
||||||
demo-extractpld
|
demo-extractpld
|
||||||
demo-extracttexture
|
demo-extracttexture
|
||||||
demo-extractmesh
|
demo-extractmesh
|
||||||
|
23
Makefile
23
Makefile
@ -1,21 +1,30 @@
|
|||||||
|
CC=gcc
|
||||||
|
CFLAGS=-I"include" -Wall -fPIC #-g
|
||||||
|
LDFLAGS=-shared
|
||||||
|
TARGET=lib3ddevil1.so
|
||||||
PEX=demo-extractpld
|
PEX=demo-extractpld
|
||||||
TEX=demo-extracttexture
|
TEX=demo-extracttexture
|
||||||
MEX=demo-extractmesh
|
MEX=demo-extractmesh
|
||||||
|
OBJ=devil1pld.o devil1tex.o devil1geo.o
|
||||||
|
|
||||||
CC=gcc
|
all: $(TARGET) demos
|
||||||
CFLAGS= -I"include" -Wall
|
|
||||||
|
|
||||||
all: pld texture mesh
|
$(TARGET): $(OBJ)
|
||||||
|
$(LINK.cc) $(LDFLAGS) $^ -o $@
|
||||||
|
|
||||||
pld: devil1pld.o devil1tex.o devil1geo.o
|
|
||||||
|
demos: pld texture mesh
|
||||||
|
|
||||||
|
pld: $(OBJ)
|
||||||
$(CC) $^ demo/extractpld.c $(CFLAGS) -o $(PEX)
|
$(CC) $^ demo/extractpld.c $(CFLAGS) -o $(PEX)
|
||||||
|
|
||||||
texture: devil1pld.o devil1tex.o devil1geo.o
|
texture: $(OBJ)
|
||||||
$(CC) $^ demo/extracttexture.c $(CFLAGS) -o $(TEX)
|
$(CC) $^ demo/extracttexture.c $(CFLAGS) -o $(TEX)
|
||||||
|
|
||||||
mesh: devil1pld.o devil1tex.o devil1geo.o
|
mesh: $(OBJ)
|
||||||
$(CC) $^ demo/extractmesh.c $(CFLAGS) -o $(MEX)
|
$(CC) $^ demo/extractmesh.c $(CFLAGS) -o $(MEX)
|
||||||
|
|
||||||
|
|
||||||
devil1pld.o: src/devil1pld.c
|
devil1pld.o: src/devil1pld.c
|
||||||
$(CC) -c $^ $(CFLAGS)
|
$(CC) -c $^ $(CFLAGS)
|
||||||
|
|
||||||
@ -26,4 +35,4 @@ devil1geo.o: src/devil1geo.c
|
|||||||
$(CC) -c $^ $(CFLAGS)
|
$(CC) -c $^ $(CFLAGS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm *.o $(EX) $(PEX) $(TEX) $(MEX)
|
rm *.o $(TARGET) $(PEX) $(TEX) $(MEX)
|
||||||
|
15
bindings/py3devil1.py
Normal file → Executable file
15
bindings/py3devil1.py
Normal file → Executable file
@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
import ctypes
|
import ctypes
|
||||||
|
|
||||||
class PldHeader(ctypes.Structure):
|
class PldHeader(ctypes.Structure):
|
||||||
@ -14,8 +15,12 @@ class Devil1FN_PLD(ctypes.Structure):
|
|||||||
]
|
]
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
libc = cdll.LoadLibrary('./libdevil1pld.so')
|
sharedlib='./lib3ddevil1.so'
|
||||||
if (lib):
|
libc = cdll.LoadLibrary(sharedlib)
|
||||||
print("OK")
|
if (not lib):
|
||||||
with open("pl01.pld", "rb") as f:
|
print("Couldn't load %s" % sharedlib)
|
||||||
data = f.read()
|
return 1
|
||||||
|
|
||||||
|
print("OK")
|
||||||
|
with open("pl01.pld", "rb") as f:
|
||||||
|
data = f.read()
|
||||||
|
Loading…
Reference in New Issue
Block a user