summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/GNUmakefile11
-rw-r--r--src/install.sh45
-rw-r--r--src/test/GNUmakefile6
3 files changed, 55 insertions, 7 deletions
diff --git a/src/GNUmakefile b/src/GNUmakefile
index 5cc058f..f654739 100644
--- a/src/GNUmakefile
+++ b/src/GNUmakefile
@@ -18,7 +18,7 @@
#
# -------------------------------------------------------------------------
#
-# $Id: GNUmakefile,v 1.6 2005-04-04 00:52:23 ianc Exp $
+# $Id: GNUmakefile,v 1.7 2005-04-05 01:01:58 ianc Exp $
#
@@ -26,9 +26,9 @@
#
# The directory to install the built library, headers and docs into.
-# *** NB: USE FORWARD SLASHES ***
+# NB: Use *forward* slashes if setting to a DOS path.
#
-INSTALLDIR = C:/w32dlib
+INSTALLDIR = /usr/local
# Set this to one to generate a wd32lib-config and copy it to /usr/local/bin
# when installing.
@@ -46,7 +46,7 @@ DEBUG = -g -DW32D_DEBUG
# Do not change past here.
# Well, unless something doesn't work of course...
#
-TARGET = w32dlib.a
+TARGET = libw32dlib.a
SOURCES = autocheck.cpp \
button.cpp \
@@ -92,6 +92,9 @@ $(DOCDIR)/html/index.html: $(HEADERS)
clean:
-rm -f $(TARGET) $(OBJECTS) depend.mak
+install: $(TARGET)
+ ./install.sh $(INSTALLDIR) $(CREATECONF)
+
depend:
@echo Dependencies updated....
$(CXX) -MM $(FLAGS) $(SOURCES) > $(DEPEND)
diff --git a/src/install.sh b/src/install.sh
new file mode 100644
index 0000000..e3274ae
--- /dev/null
+++ b/src/install.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+#
+# Install script to w32dlib
+#
+# $Id$
+#
+
+if [ "$2" == "" ] ; then
+ echo usage: $0 install-dir script-flag
+ exit 1
+fi
+
+incbase=$1/include
+incdir=$incbase/w32dlib
+libdir=$1/lib
+mkinfo=$2
+conf=/usr/local/bin/w32dlib-config
+
+echo ==== Copying header files to $incdir ====
+mkdir -p $incdir
+cp --verbose --force w32dlib/*.h $incdir
+
+echo ==== Copying library files to $libdir ====
+mkdir -p $libdir
+cp --verbose --force libw32dlib.a $libdir
+
+if [ $mkinfo == "1" ] ; then
+ echo ==== Creating $conf ====
+
+ cat << EOF > $conf
+#!/bin/sh
+
+if [ "\$1" == "--libs" ] ; then
+ echo -L$libdir -mwindows -lw32dlib
+elif [ "\$1" == "--cflags" ] ; then
+ echo -I$incbase
+else
+ echo usage: \$0 [--libs\|--cflags]
+fi
+
+EOF
+
+fi
+
+exit 0
diff --git a/src/test/GNUmakefile b/src/test/GNUmakefile
index 97ca9c0..fe28cb0 100644
--- a/src/test/GNUmakefile
+++ b/src/test/GNUmakefile
@@ -18,7 +18,7 @@
#
# -------------------------------------------------------------------------
#
-# $Id: GNUmakefile,v 1.1 2005-03-24 00:07:40 ianc Exp $
+# $Id: GNUmakefile,v 1.2 2005-04-05 01:01:58 ianc Exp $
#
@@ -26,7 +26,7 @@ TARGET = w32dtst.exe
SOURCES = w32dtst.cpp
-LIB = ../w32dlib.a
+LIB = -L.. -lw32dlib
RES = dialog
@@ -36,7 +36,7 @@ FLAGS = -I.. -Wall -L.. -g
DEPEND = depend.mak
-$(TARGET): $(OBJECTS) $(LIB)
+$(TARGET): $(OBJECTS) ../libw32dlib.a
$(CXX) -o $(TARGET) $(FLAGS) $(OBJECTS) -mwindows -mconsole $(LIB)
$(RES).o: $(RES).rc $(RES).h