Skip to content

Commit

Permalink
Combine CPython wrapper into a single target
Browse files Browse the repository at this point in the history
I don't know why I thought it was a good idea to split that into two
parts. Just do it with one command.
Interestingly, the old way worked perfectly fine on arch, but produced
an empty .so on debian. Huh!
  • Loading branch information
vkoskiv committed Dec 6, 2023
1 parent dcd256d commit 53b146f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ $(LIB): $(OBJS_lib) $(OBJDIR_lib)
$(BIN_lib): $(LIB) $(OBJS_driver) $(OBJDIR_driver)
@echo "LD $@"
@$(CC) $(CFLAGS) $(OBJS_driver) $(LIB) -o $@ $(LDFLAGS)
wrappers/cray.o: wrappers/cray.c
@echo "CC -fPIC $@"
@$(CC) `pkg-config --cflags python3` $(CFLAGS) -o wrappers/cray.o -shared -fPIC wrappers/cray.c
wrappers/cray.so: $(LIB) wrappers/cray.o
wrappers/cray.so: $(LIB) wrappers/cray.c
@echo "Building Python module"
@$(CC) -shared -fPIC wrappers/cray.o $(LIB) -o $@
@$(CC) -shared $(CFLAGS) -fPIC `pkg-config --cflags python3` wrappers/cray.c $(LIB) -o $@

0 comments on commit 53b146f

Please sign in to comment.