|
From: William S. <wil...@gm...> - 2010-11-26 09:54:44
|
Now I know how to compile my own mingw library, for all eternity.
Here is the makefile:
======================
libdir = c:\mingw\local\lib
includedir = c:\mingw\local\include
rand: rand.c
echo ${CURDIR}
gcc -c rand.c
ar rvs librand.a rand.o
del "$(CURDIR)\rand.o"
move "$(CURDIR)\librand.a" $(libdir)
copy "$(CURDIR)\rand.h" $(includedir)
======================
What make said:
C:\MinGW\local\lib\src\rand>make
echo C:/MinGW/local/lib/src/rand
C:/MinGW/local/lib/src/rand
gcc -c rand.c
ar rvs librand.a rand.o
ar: creating librand.a
a - rand.o
del "C:/MinGW/local/lib/src/rand\rand.o"
move "C:/MinGW/local/lib/src/rand\librand.a" c:\mingw\local\lib
copy "C:/MinGW/local/lib/src/rand\rand.h" c:\mingw\local\include
1 file(s) copied.
I came up with this after hours of trial and error. For example,
slashes wouldn't work, only backslashes. I discovered CURDIR, and it
was the only way to make it work, because make would not recognise
where it was for purposes of del and copy otherwise. It is a horrible
kludge I know, but at least it works.
Cheers
Bill
|