summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbringert <unknown>2005-05-10 10:45:00 +0000
committerbringert <unknown>2005-05-10 10:45:00 +0000
commit6896332b66200df120860558542ba11aefaceeb0 (patch)
treeca39722301eaa4028929dcf6247664834f78a519 /src
parent0d5329eaf841221ad3441f8c8361492735206a9c (diff)
Get executable suffix in configure, unify unix and windows make targets.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile41
-rw-r--r--src/Makefile.binary4
-rw-r--r--src/config.mk.in3
-rw-r--r--src/configure.ac16
4 files changed, 43 insertions, 21 deletions
diff --git a/src/Makefile b/src/Makefile
index 3d6112b5b..2283d1cd7 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -5,6 +5,7 @@ GHMAKE=$(GHC) --make
GHCXMAKE=ghcxmake
GHCFLAGS= -package util -fglasgow-exts $(CPPFLAGS) $(LDFLAGS)
GHCOPTFLAGS=-O2
+GHCWINFLAGS=-package readline
GHCFUDFLAG=
JAVAFLAGS=-target 1.4 -source 1.4
@@ -19,23 +20,30 @@ BIN_DIST_DIR=$(DIST_DIR)-$(host)
SNAPSHOT_DIR=GF-$(shell date +%Y%m%d)
-.PHONY: all install install-gf install-gfdoc install-editor \
+GF_EXE=gf$(EXEEXT)
+GF_EXE_TMP=gf-bin$(EXEEXT)
+GF_DOC_EXE=gfdoc$(EXEEXT)
+
+.PHONY: all unix jar gfdoc windows install install-gf \
+ temp install-gfdoc install-editor \
today help clean
-all: unix tools/gfdoc jar
+all: unix gfdoc jar
unix: today touch-files opt
-windows: today touch-files justwindows
+windows: unix
temp: today touch-files noopt
+# use gf-bin name to not clash with GF/ dir on
+# case insensitive file systems
build:
- $(GHMAKE) $(GHCFLAGS) GF.hs -o gf
- strip gf
- mv gf ../bin/gf
+ $(GHMAKE) $(GHCFLAGS) GF.hs -o $(GF_EXE_TMP)
+ strip $(GF_EXE_TMP)
+ mv $(GF_EXE_TMP) ../bin/$(GF_EXE)
opt: GHCFLAGS += $(GHCOPTFLAGS)
opt: build
@@ -54,13 +62,8 @@ gft:
strip gft-bin
mv gft-bin ../bin/gft
-justwindows:
- $(GHMAKE) $(GHCFLAGS) $(GHCOPTFLAGS) GF.hs -o gf.exe
- strip gf.exe
- mv gf.exe ../bin/
-
api:
- $(GHMAKE) $(GHCFLAGS) $(GHCOPTFLAGS)GF/API.hs
+ $(GHMAKE) $(GHCFLAGS) $(GHCOPTFLAGS) GF/API.hs
shell:
$(GHMAKE) $(GHCFLAGS) $(GHCOPTFLAGS) GF/Shell.hs
@@ -72,7 +75,7 @@ clean:
distclean: clean
-rm -f JavaGUI/gf-java.jar jgf
- -rm -f tools/gfdoc
+ -rm -f tools/$(GF_DOC_EXE)
-rm -f config.status config.mk config.log
-rm -f *.tgz *.zip
-rm -rf $(DIST_DIR) $(BIN_DIST_DIR)
@@ -124,8 +127,10 @@ GF/Shell/HelpFile.hs: tools/MkHelpFile HelpFile
# Tools
#
-tools/gfdoc: tools/GFDoc.hs
- $(GHMAKE) -o $@ $^
+gfdoc: tools/$(GF_DOC_EXE)
+
+tools/$(GF_DOC_EXE): tools/GFDoc.hs
+ $(GHMAKE) $(GHCOPTFLAGS) -o $@ $^
#
# Distribution
@@ -156,7 +161,7 @@ binary-dist:
CPPFLAGS="`lib__readline -I` `lib__ncurses -I`" \
LDFLAGS="`lib__readline -l` `lib__ncurses -l`"
$(MAKE) all
- $(INSTALL) ../bin/gf tools/gfdoc $(BIN_DIST_DIR)
+ $(INSTALL) ../bin/$(GF_EXE)tools/$(GF_DOC_EXE) $(BIN_DIST_DIR)
$(INSTALL) -m 0644 JavaGUI/gf-java.jar $(BIN_DIST_DIR)
$(INSTALL) configure config.guess config.sub install-sh $(BIN_DIST_DIR)
$(INSTALL) -m 0644 config.mk.in jgf.in $(BIN_DIST_DIR)
@@ -174,11 +179,11 @@ install: install-gf install-gfdoc install-editor
install-gf:
$(INSTALL) -d $(bindir)
- $(INSTALL) ../bin/gf $(bindir)
+ $(INSTALL) ../bin/$(GF_EXE) $(bindir)
install-gfdoc:
$(INSTALL) -d $(bindir)
- $(INSTALL) tools/gfdoc $(bindir)
+ $(INSTALL) tools/$(GF_DOC_EXE) $(bindir)
install-editor:
$(INSTALL) -d $(datadir)/GF-$(PACKAGE_VERSION)
diff --git a/src/Makefile.binary b/src/Makefile.binary
index 747269030..669af92cc 100644
--- a/src/Makefile.binary
+++ b/src/Makefile.binary
@@ -5,10 +5,10 @@ GF_DATA_DIR=$(datadir)/GF-$(PACKAGE_VERSION)
.PHONY: install
install:
$(INSTALL) -d $(bindir)
- $(INSTALL) gf gfdoc jgf $(bindir)
+ $(INSTALL) gf$(EXEEXT) gfdoc$(EXEEXT) jgf $(bindir)
$(INSTALL) -d $(GF_DATA_DIR)
$(INSTALL) -m 0644 gf-java.jar $(GF_DATA_DIR)
uninstall:
- -rm -f $(bindir)/gf $(bindir)/gfdoc $(bindir)/jgf
+ -rm -f $(bindir)/gf$(EXEEXT) $(bindir)/gfdoc$(EXEEXT) $(bindir)/jgf
-rm -f $(GF_DATA_DIR)/gf-java.jar
diff --git a/src/config.mk.in b/src/config.mk.in
index 0b93a6b32..e75c8e98f 100644
--- a/src/config.mk.in
+++ b/src/config.mk.in
@@ -14,6 +14,8 @@ host = @host@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
+EXEEXT = @EXEEXT@
+
INSTALL = @INSTALL@
GHC = @GHC@
@@ -21,3 +23,4 @@ GHCI = @GHCI@
JAVAC = @JAVAC@
JAR = @JAR@
+
diff --git a/src/configure.ac b/src/configure.ac
index da6bc7df1..db855dda4 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -4,12 +4,26 @@ AC_INIT([GF],[2.2],[aarne@cs.chalmers.se],[GF])
AC_PREREQ(2.53)
-AC_REVISION($Revision: 1.11 $)
+AC_REVISION($Revision: 1.12 $)
AC_CONFIG_FILES([config.mk jgf])
AC_CANONICAL_HOST
+dnl ***********************************************
+dnl Executable suffix
+dnl ***********************************************
+
+
+AC_MSG_CHECKING([executable suffix])
+case $host_os in
+ cygwin)
+ EXEEXT='.exe';;
+ *)
+ EXEEXT='';;
+esac
+AC_MSG_RESULT(['$EXEEXT'])
+AC_SUBST(EXEEXT)
dnl ***********************************************
dnl GHC