Ignore:
Timestamp:
Nov 23, 2013 7:13:40 AM (11 years ago)
Author:
bennylp
Message:

Fixed #1713: Enable building the libraries as shared libraries/DLLs for GNU targets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/build/Makefile

    r4637 r4656  
    22include $(PJDIR)/build/common.mak 
    33 
     4export LIBDIR := ../lib 
     5export BINDIR := ../bin 
    46 
    57RULES_MAK := $(PJDIR)/build/rules.mak 
     
    2830export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \ 
    2931                   $(HOST_CXXFLAGS) $(CXXFLAGS) 
     32export _LDFLAGS := $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \ 
     33                   $(APP_LDFLAGS) $(APP_LDLIBS) $(LDFLAGS)  
    3034 
    3135############################################################################### 
     
    3842export PJSUA_CFLAGS += $(_CFLAGS) 
    3943export PJSUA_CXXFLAGS += $(_CXXFLAGS) 
    40 export PJSUA_LDFLAGS += $(APP_LDFLAGS) $(APP_LDLIBS) $(LDFLAGS) 
    41 export PJSUA_EXE:=../bin/pjsua-$(TARGET_NAME)$(HOST_EXE) 
     44export PJSUA_LDFLAGS += $(_LDFLAGS) 
     45export PJSUA_EXE:=pjsua-$(TARGET_NAME)$(HOST_EXE) 
    4246 
    4347 
     
    5054export PJSYSTEST_CFLAGS += $(_CFLAGS) 
    5155export PJSYSTEST_CXXFLAGS += $(_CXXFLAGS) 
    52 export PJSYSTEST_LDFLAGS += $(APP_LDFLAGS) $(APP_LDLIBS) $(LDFLAGS) 
    53 export PJSYSTEST_EXE:=../bin/pjsystest-$(TARGET_NAME)$(HOST_EXE) 
     56export PJSYSTEST_LDFLAGS += $(_LDFLAGS) 
     57export PJSYSTEST_EXE:=pjsystest-$(TARGET_NAME)$(HOST_EXE) 
    5458 
    5559 
     
    5963# 
    6064# 
    61 TARGETS := pjsua pjsystest samples 
     65TARGETS := $(BINDIR)/$(PJSUA_EXE) $(BINDIR)/$(PJSYSTEST_EXE) samples 
    6266 
    6367all: $(TARGETS) 
     
    6872distclean: realclean 
    6973 
    70 .PHONY: dep depend clean realclean distclean 
     74.PHONY: all dep depend clean realclean distclean 
    7175.PHONY: $(TARGETS) 
    7276.PHONY: $(PJSUA_EXE) $(PJSYSTEST_EXE) 
     
    7478pjsua: $(PJSUA_EXE) 
    7579$(PJSUA_EXE): 
    76         $(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $(PJSUA_EXE) 
     80        $(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $(subst /,$(HOST_PSEP),$(BINDIR)/$@) 
    7781 
    7882pjsystest: $(PJSYSTEST_EXE) 
    7983$(PJSYSTEST_EXE): 
    80         $(MAKE) -f $(RULES_MAK) APP=PJSYSTEST app=pjsystest $(PJSYSTEST_EXE) 
     84        $(MAKE) -f $(RULES_MAK) APP=PJSYSTEST app=pjsystest $(subst /,$(HOST_PSEP),$(BINDIR)/$@) 
    8185 
    8286samples: 
    8387        $(MAKE) -f Samples.mak 
    8488 
    85 .PHONY: ../lib/pjsua.ko 
    86 ../lib/pjsua.ko: 
    87         $(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $@ 
     89.PHONY: pjsua.ko 
     90pjsua.ko: 
     91        $(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) 
    8892 
    8993clean depend realclean: 
     
    9296        $(MAKE) -f Samples.mak $@ 
    9397        @if test "$@" = "depend"; then \ 
    94           echo '$(PJSUA_EXE): $(APP_LIB_FILES)' >> .pjsua-$(TARGET_NAME).depend; \ 
    95           echo '$(PJSYSTEST_EXE): $(APP_LIB_FILES)' >> .pjsystest-$(TARGET_NAME).depend; \ 
     98          echo '$(BINDIR)/$(PJSUA_EXE): $(APP_LIB_FILES)' >> .pjsua-$(TARGET_NAME).depend; \ 
     99          echo '$(BINDIR)/$(PJSYSTEST_EXE): $(APP_LIB_FILES)' >> .pjsystest-$(TARGET_NAME).depend; \ 
    96100        fi 
    97101 
Note: See TracChangeset for help on using the changeset viewer.