help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is it possible to build a SO by setting builtin variables only?


From: a gander
Subject: Is it possible to build a SO by setting builtin variables only?
Date: Fri, 8 Jun 2012 23:26:33 +0100

I am quite happily compiling small C++/C executables by:
i) not using a Makefile: -f /dev/null;
ii) setting builtin variables accordingly

Example:

make -f /dev/null LOADLIBES="-L${HOME}/lib64 -L." \
LDLIBS=" $(pkg-config --libs-only-l glibmm2.4)" \
CFLAGS="-ggdb3" \
CXXFLAGS="-gdwarf-2  -Wall $(pkg-config --cflags glibmm2.4)" \
CPPFLAGS="$(pkg-config --cflags glibmm2.4) -m64 -mtune=generic -O0 -I." \
some_code.cpp

Is it possible to the same for but for a SO library (-shared -fPIC)?

I have experimented but decided its not so have created a basic Makefile:
=======================================
LINK.so = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
# environment
SUFFIXES := .out .a .ln .o .c .cc .C .cpp .p .f .F .m .r .y .l .ym .yl .s
.S .mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo .w .ch .web .sh
.elc .el .so

# Implicit Rules

%.so: %.o
    #  recipe to build so:
        $(LINK.so) $^ $(LOADLIBES) $(LDLIBS) -shared -o address@hidden

=======================================

So far, though, its a no-go .

Has anyone else tried and succeeded to do this?

I am using:
GNU Make 3.82
gcc 4.6.3

-- 
Giles Anderson


reply via email to

[Prev in Thread] Current Thread [Next in Thread]