diff options
Diffstat (limited to 'plugins/gpulib/Makefile')
-rw-r--r-- | plugins/gpulib/Makefile | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/plugins/gpulib/Makefile b/plugins/gpulib/Makefile index 2739e5c..4a45aa2 100644 --- a/plugins/gpulib/Makefile +++ b/plugins/gpulib/Makefile @@ -23,15 +23,28 @@ OBJS += cspace.o endif CFLAGS += $(PLUGIN_CFLAGS) +# need to compile to another dir, same files are compiled +# into main binary without PIC +OBJS2 = $(patsubst %.o,obj/%.o,$(OBJS)) + TARGET = gpulib.$(EXT) -all: ../../config.mak $(TARGET) +all: ../../config.mak obj $(TARGET) -$(TARGET): $(OBJS) +$(TARGET): $(OBJS2) $(AR) crs $@ $^ +obj/%.o: %.c + $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $^ + +obj/%.o: %.s + $(AS) $(ASFLAGS) -o $@ $^ + clean: - $(RM) $(TARGET) $(OBJS) + $(RM) $(TARGET) $(OBJS2) + +obj: + mkdir -p $@ ../../config.mak: @echo "Please run ./configure before running make!" |