Revision d2c7b084 Makefile

View differences:

Makefile
15 15
CFLAGS += $(call cc-option, -funit-at-a-time)
16 16

  
17 17
LINKER = $(CC)
18
STATIC ?= 0
18 19

  
19 20
NAPA ?= ../../NAPA-BASELIBS
20 21
GRAPES ?= ../../GRAPES
......
58 59
LDFLAGS += -L$(NAPA)/dclog -L$(NAPA)/rep -L$(NAPA)/monl -L$(NAPA)/common
59 60
LDLIBS += -lstdc++ -lmon -lrep -ldclog -lcommon
60 61
CPPFLAGS += -DMONL
61
ifdef STATIC
62
ifneq ($(STATIC), 0)
62 63
LINKER=g++
63 64
endif
64 65
endif
......
174 175
EXECTARGET := $(EXECTARGET)-$(IO)
175 176
endif
176 177

  
177
ifdef STATIC
178
LDFLAGS += -static -v
178
ifeq ($(STATIC), 1)
179
EXECTARGET := $(EXECTARGET)-halfstatic
180
LDFLAGS += -Wl,-static
181
LDFLAGSPOST += -Wl,-Bdynamic
182
endif
183
ifeq ($(STATIC), 2)
179 184
EXECTARGET := $(EXECTARGET)-static
185
LDFLAGS += -static
180 186
endif
181 187

  
182 188
ifdef DEBUG
......
194 200
else
195 201
$(EXECTARGET): $(OBJS) $(GRAPES)/src/net_helper-ml.o $(EXECTARGET).o
196 202
endif
197
	$(LINKER) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
203
	$(LINKER) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) $(LDFLAGSPOST) -o $@
198 204

  
199 205
$(EXECTARGET).o: streamer.o
200 206
	ln -sf streamer.o $(EXECTARGET).o

Also available in: Unified diff