2 # Makefile for win32 bacula executables
3 # Using MinGW cross-compiler on GNU/Linux
5 # Written by Robert Nelson, June 2006
9 $(ECHO_CMD)rm -f $(1) $(patsubst %.o,%.d,$(filter-out %.res,$(1)))
13 $(ECHO_CMD)rm -f $(1) $(addsuffix .dbg,$(basename $(1)))
17 @if [ ! -e $(dir $(1)) ]; then mkdir $(dir $(1)); fi
21 @echo "Generating dependencies for $<"
23 $(ECHO_CMD)$(CXX) -MM $(CPPFLAGS) $< > $@.$$$$; \
24 sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
31 $(ECHO_CMD)$(CXX) $(CFLAGS) $(LDFLAGS) -mconsole $^ $(1) -o $@
37 $(ECHO_CMD)$(CXX) $(CFLAGS) $(LDFLAGS) -mwindows $^ $(1) -o $@
41 @echo "Stripping debug info from $@"
43 $(ECHO_CMD)$(OBJCPY) --only-keep-debug $@ $(addsuffix .dbg,$(basename $@)) ; \
44 $(OBJCPY) --strip-debug $@ ; \
45 $(OBJCPY) --add-gnu-debuglink=$(addsuffix .dbg,$(basename $@)) $@
51 $(ECHO_CMD)$(CXX) $(CFLAGS) -c $< -o $@
56 $(ECHO_CMD)$(CXX) $(CFLAGS) -c $< -o $@
61 $(ECHO_CMD)$(WINDRES) -O coff $< -o $@
70 ifneq ($(MAKECMDGOALS),clean)
71 include $(patsubst %.o,%.d,$(filter-out %.res,$(ALL_OBJS)))