Describe how to compile “getoptpp” as shaded library from my own GNU Makefile and static link it to my program?
What I do:
At my program directory I unarchived getoptpp library to subdirectory with the same name.
than added new target to my Makefile: (README say I used SHARED flag to make. $> make SHARED=n)
getoptpp:
cd getoptpp; $(MAKE) SHARED=n
than I added this target to list of requested targets of my program:
myprogram: getoptpp
g++ **** myprogram
but after calling make myprogram – no new .so created at all.
when calling “make getoptpp” – make say ‘is up to date’
*ADDED: after suggestion of .PHONY there is an error *
cd getoptpp; make SHARED=n
"Makefile", line 15: Missing dependency operator
"Makefile", line 19: Need an operator
"Makefile", line 24: Need an operator
"Makefile", line 45: Missing dependency operator
"Makefile", line 47: Need an operator
make: fatal errors encountered -- cannot continue
*** Error code 1
http://code.google.com/p/getoptpp/
OR
Please, suggest pretty nice command line parsing library for my c++ program. That I can simple compile as .o object that link to my program. No Boost!
The directory exists and is not updated, so yes, it is up to date. Perhaps you want to declare it as a dependency of
.PHONY.