--- a/Makefile
+++ b/Makefile
@@ -10,13 +10,15 @@
 
 PREFIX ?= /usr
 
+EXE_EXT ?= .x
+
 install: default
 	install -d $(DESTDIR)$(PREFIX)/bin/
-	for x in wannier90.x postw90.x w90chk2chk.x w90spn2spn.x ; do \
+	for x in wannier90${EXE_EXT} postw90${EXE_EXT} w90chk2chk${EXE_EXT} w90spn2spn${EXE_EXT} ; do \
 		if [ -f "$$x" ]; then install -m755 "$$x" "$(DESTDIR)$(PREFIX)/bin/$$x"; fi; \
 	done
 	if [ -f "utility/w90pov/w90pov" ]; then install -m755 "utility/w90pov/w90pov" "$(DESTDIR)$(PREFIX)/bin/w90pov"; fi;
-	if [ -f "utility/w90vdw/w90vdw.x" ]; then install -m755 "utility/w90vdw/w90vdw.x" "$(DESTDIR)$(PREFIX)/bin/w90vdw.x"; fi;
+	if [ -f "utility/w90vdw/w90vdw${EXE_EXT}" ]; then install -m755 "utility/w90vdw/w90vdw${EXE_EXT}" "$(DESTDIR)$(PREFIX)/bin/w90vdw${EXE_EXT}"; fi;
 	install -d $(DESTDIR)$(PREFIX)/lib/
 	if [ -f "libwannier.a" ]; then install -m644 "libwannier.a" "$(DESTDIR)$(PREFIX)/lib/libwannier.a"; fi;
 
@@ -73,7 +75,7 @@
 	cd $(ROOTDIR)/test-suite && ./clean_tests
 
 veryclean: clean
-	cd $(ROOTDIR) && rm -f wannier90.x postw90.x libwannier.a w90chk2chk.x w90spn2spn.x
+	cd $(ROOTDIR) && rm -f wannier90${EXE_EXT} postw90${EXE_EXT} libwannier.a w90chk2chk${EXE_EXT} w90spn2spn${EXE_EXT}
 	cd $(ROOTDIR)/doc && rm -f user_guide.pdf tutorial.pdf
 	cd $(ROOTDIR)/doc/user_guide && rm -f user_guide.ps
 	cd $(ROOTDIR)/doc/tutorial && rm -f tutorial.ps 
--- a/src/Makefile.2
+++ b/src/Makefile.2
@@ -26,27 +26,27 @@
 
 wannier libs dynlibs w90chk2chk serialobjs w90spn2spn: POSTOPTS = $(TEMP1)
 wannier libs dynlibs w90chk2chk serialobjs w90spn2spn: COMPILER = $(TEMP2)
-wannier: ../../wannier90.x 
-w90chk2chk: ../../w90chk2chk.x
-w90spn2spn: ../../w90spn2spn.x
+wannier: ../../wannier90${EXE_EXT} 
+w90chk2chk: ../../w90chk2chk${EXE_EXT}
+w90spn2spn: ../../w90spn2spn${EXE_EXT}
 
 serialobjs: $(OBJS)
 
-../../w90chk2chk.x: $(OBJS) ../w90chk2chk.F90
-	$(COMPILER) ../w90chk2chk.F90 $(LDOPTS) $(OBJS) $(LIBS) -o ../../w90chk2chk.x
+../../w90chk2chk${EXE_EXT}: $(OBJS) ../w90chk2chk.F90
+	$(COMPILER) ../w90chk2chk.F90 $(LDOPTS) $(OBJS) $(LIBS) -o ../../w90chk2chk${EXE_EXT}
 
-../../w90spn2spn.x: $(OBJS) ../w90spn2spn.F90
-	$(COMPILER) ../w90spn2spn.F90 $(LDOPTS) $(OBJS) $(LIBS) -o ../../w90spn2spn.x
+../../w90spn2spn${EXE_EXT}: $(OBJS) ../w90spn2spn.F90
+	$(COMPILER) ../w90spn2spn.F90 $(LDOPTS) $(OBJS) $(LIBS) -o ../../w90spn2spn${EXE_EXT}
 
-../../wannier90.x: $(OBJS) ../wannier_prog.F90
-	$(COMPILER) ../wannier_prog.F90 $(POSTOPTS) $(LDOPTS) $(OBJS) $(LIBS) -o ../../wannier90.x
+../../wannier90${EXE_EXT}: $(OBJS) ../wannier_prog.F90
+	$(COMPILER) ../wannier_prog.F90 $(POSTOPTS) $(LDOPTS) $(OBJS) $(LIBS) -o ../../wannier90${EXE_EXT}
 
 post: POSTOPTS = $(TEMP1)
 post: COMPILER = $(TEMP2)
-post: mpi_test ../../postw90.x
+post: mpi_test ../../postw90${EXE_EXT}
 
-../../postw90.x: $(OBJS_POST) $(POSTDIR)postw90.F90
-	$(COMPILER) $(POSTDIR)postw90.F90 $(POSTOPTS) $(LDOPTS) $(OBJS_POST) $(LIBS) -o ../../postw90.x
+../../postw90${EXE_EXT}: $(OBJS_POST) $(POSTDIR)postw90.F90
+	$(COMPILER) $(POSTDIR)postw90.F90 $(POSTOPTS) $(LDOPTS) $(OBJS_POST) $(LIBS) -o ../../postw90${EXE_EXT}
 
 mpi_test :
 ifeq ($(COMMS),mpi)
