14 Mar 2012 20:09
Reusing the Chibi Scheme Makefile to Build Libraries
Hi, I needed to compile a library on a couple of different platforms. I figured the easiest way was to reuse the information in the Makefile for Chibi Scheme itself. So, my library's Makefile looks like this: include $(CHIBI_SCHEME_SRCDIR)/Makefile MY_COMPILED_LIBS := my-lib/clock/system-clock$(SO) XCFLAGS += -Wall my-libs: $(MY_COMPILED_LIBS) my-clean: rm -f $(MY_COMPILED_LIBS) my-lib/%$(SO): my-lib/%.c $(MY_INCLUDES) -$(CC) $(CLIBFLAGS) -I$(PREFIX)/include $(XCPPFLAGS) $(XCFLAGS) -o $ <at> $< -L$(PREFIX)/lib -lchibi-scheme This works, but it's a bit of a hack. For example, I can't put my source code under the subdirectory "lib" because that conflicts with the Chibi Scheme lib. Does anyone have any better solution? Is this sort of reuse something that Alex would like to encourage? If so, it might be worth moving these rules into the Chibi Scheme Makefile, so that the Makefile for a library is simply a couple of variable definitions (e.g., MY_COMPILED_LIBS) and the include directive. Regards, Alan(Continue reading)
Alan
RSS Feed