Chapter 12: Extending GNU make 141
all:
@echo Temporary file: $(mk-temp tmpfile.)
load mk_temp.so
mk_temp.so: mk_temp.c
$(CC) -shared -fPIC -o $ $<
On MS-Windows, due to peculiarities of how shared objects are produced, the
compiler needs to scan the import library produced when building make, typically called
li/jointfilesconvert/351026/bgnumake-version.dll.a, where version is the version of the load object API. So
the recipe to produce a shared object will look on Windows like this (assuming the API
version is 1):
mk_temp.dll: mk_temp.c
$(CC) -shared -o $ $< -lgnumake-1
Now when you run make you’ll see something like:
$ make
cc -shared -fPIC -o mk_temp.so mk_temp.c
Temporary filename: tmpfile.A7JEwd
Comentários a estes Manuais