#
CONSSRCS = main.cpp console_thread.cpp authenticate.c console_conf.c wxbrestorepanel.cpp \
- wxbmainframe.cpp wxbtableparser.cpp wxbtreectrl.cpp wxblistctrl.cpp
+ wxbmainframe.cpp wxbtableparser.cpp wxbtreectrl.cpp wxblistctrl.cpp wxbutils.cpp \
+ wxbconfigpanel.cpp wxbconfigfileeditor.cpp wxbhistorytextctrl.cpp
CONSOBJS = main.o console_thread.o authenticate.o console_conf.o wxbrestorepanel.o \
- wxbmainframe.o wxbtableparser.o wxbtreectrl.o wxblistctrl.o
+ wxbmainframe.o wxbtableparser.o wxbtreectrl.o wxblistctrl.o wxbutils.o \
+ wxbconfigpanel.o wxbconfigfileeditor.o wxbhistorytextctrl.o
-@if test "@DISTNAME@" = "cygwin" then \
-RES = wx-console_private.res; \
-else \
-RES = ;\
-fi
+win32 = wx-console_private.res
+
+WIN32RES = $(@WIN32@)
+
+macosx = wx-console.app
+
+MACOSXAPP = $(@MACOSX@)
# these are the objects that are changed by the .configure process
EXTRAOBJS = @OBJLIST@
-CONS_INC=
-CONS_LIBS=
+macosx_cppflags = -DHAVE_MACOSX -DNO_GCC_PRAGMA
+
+_cppflags =
# wx-config generated by configure
-CONS_CPPFLAGS=@WXCONS_CPPFLAGS@
+CONS_CPPFLAGS=-DHAVE_WXCONSOLE @WXCONS_CPPFLAGS@ $(@MACOSX@_cppflags)
CONS_LDFLAGS=@WXCONS_LDFLAGS@
.SUFFIXES: .cpp .c .o
#-------------------------------------------------------------------------
-all: Makefile wx-console
+all: Makefile wx-console $(MACOSXAPP)
@echo "==== Make of wx-console is good ===="
@echo " "
+# Mac OS X application bundle
+# See http://216.239.59.104/search?q=cache:a61SGKgoHSQJ:wiki.wxwidgets.org/wiki.pl%3FWxMac_Issues+wxmac+%22application+bundle%22&hl=fr
+
+wx-console.app: wx-console
+ -mkdir wx-console.app
+ -mkdir wx-console.app/Contents
+ -mkdir wx-console.app/Contents/MacOS
+ -mkdir wx-console.app/Contents/Resources
+ -mkdir wx-console.app/Contents/Resources/English.lproj
+ echo -n 'APPL????' > wx-console.app/Contents/PkgInfo
+ mv wx-console wx-console.app/Contents/MacOS/wx-console
+ cp wx-console.conf /Library/Preferences/org.bacula.wxconsole.conf
-wx-console: $(CONSOBJS) $(RES) ../lib/libbac.a
- $(CXX) $(CONSOBJS) $(RES) -o $@ $(LIBS) -L../lib $(CONS_LDFLAGS) -lbac
+wx-console: $(CONSOBJS) @WIN32@ ../lib/libbac.a
+ $(CXX) $(CONSOBJS) $(WIN32RES) -o $@ $(LIBS) -L../lib $(CONS_LDFLAGS) -lbac
+
+win32: wx-console_private.res
+
wx-console_private.res: wx-console_private.rc
windres.exe -i wx-console_private.rc -I rc -o wx-console_private.res -O coff
clean:
- @$(RMF) $(OBJ) wx-console
+ @$(RMF) $(CONSOBJS) wx-console $(WIN32RES)
distclean: clean
$(RMF) Makefile
cd $(topdir) \
&& CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+install: all
+ $(INSTALL_PROGRAM) wx-console $(DESTDIR)$(sbindir)/wx-console
+ @srcconf=wx-console.conf; \
+ if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
+ destconf=$$srcconf.new; \
+ echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
+ else \
+ destconf=$$srcconf; \
+ fi; \
+ echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
+ ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
+
+uninstall:
+ (cd $(DESTDIR)$(sbindir); $(RMF) wx-console)
+ (cd $(DESTDIR)$(sysconfdir); $(RMF) wx-console.conf wx-console.conf.new)
+
# Semi-automatic generation of dependencies:
# Use gcc -MM because X11 `makedepend' doesn't work on all systems
# and it also includes system headers.