Index: Makefile.in
--- Makefile.in.orig	2006-03-04 17:29:39 +0100
+++ Makefile.in	2006-09-17 22:56:38 +0200
@@ -72,9 +72,9 @@
 mandir	    = @mandir@
 
 epic        = @epic@
-epic_exe    = $(bindir)/$(epic)
-wserv_exe   = $(libexecdir)/wserv4
-epicdir     = $(sharedir)/$(epic)
+epic_exe    = $(epic)
+wserv_exe   = $(bindir)/wserv4
+epicdir     = $(sharedir)
 
 ############ You ought not change anything below this line ###################
 
@@ -111,23 +111,12 @@
 epic: source/Makefile Makefile
 	@cd source; $(MAKE2) all
 
-EPIC 	  = $(epic_exe)-$(VERSION)
+EPIC 	  = $(epic_exe)
 EPIC_OLD  = $(epic_exe).old
 EPIC_LINK = $(epic_exe)
 installepic installirc: epic installdirs test
-	if ./my_test \( ! -f $(IP)$(EPIC) \) \
-			-o source/epic -nt $(IP)$(EPIC); then \
-		$(INSTALL_PROGRAM) source/epic $(IP)$(EPIC);	\
-		if ./my_test -f $(IP)$(EPIC_OLD); then \
-			$(RM) $(IP)$(EPIC_OLD); \
-		fi; \
-		if ./my_test -f $(IP)$(EPIC_LINK); then \
-			$(MV) $(IP)$(EPIC_LINK) $(IP)$(EPIC_OLD); \
-		fi; \
-		$(RM) $(IP)$(EPIC_LINK); \
-		ln -s $(epic)-$(VERSION) $(IP)$(EPIC_LINK); \
-	fi
-
+	$(INSTALL_PROGRAM) source/epic $(DESTDIR)$(bindir)
+	
 #
 # wserv
 #
@@ -136,19 +125,16 @@
 
 WSERV	 = $(wserv_exe)
 installwserv: wserv4 installdirs test
-	if ./my_test \( \! -f $(IP)$(WSERV) \) -o \
-			source/wserv4 -nt $(IP)$(WSERV); then	\
-		$(INSTALL_PROGRAM) source/wserv4 $(IP)$(WSERV);	\
-	fi
-
-
+	@srcdir@/mkinstalldirs $(DESTDIR)$(bindir)
+	$(INSTALL_PROGRAM) source/wserv4 $(DESTDIR)$(bindir)
+	
 #
 # Script library
 #
 scriptdir = $(epicdir)/script
 installscript: installdirs test
 	-@(								\
-		if ./my_test -f $(IP)$(scriptdir)/local; then		\
+		if ./my_test -f $(DESTDIR)$(scriptdir)/local; then	\
 			if ./my_test -f script/local; then 		\
 				$(MV) @srcdir@/script/local 		\
 					@srcdir@/script/local.orig;	\
@@ -161,7 +147,7 @@
 			if ./my_test -x $$i; then \
 				chmod a-x $$i; \
 			fi; \
-			target=$(IP)$(scriptdir)/`basename $$i`; \
+			target=$(DESTDIR)$(scriptdir)/`basename $$i`; \
 			if ./my_test -f $$target; then \
 				if ./my_test $$i -nt $$target; then \
 					$(INSTALL_DATA) $$i $$target; \
@@ -173,7 +159,7 @@
 				fi; \
 			else \
 				$(INSTALL_DATA) $$i $$target; \
-				if ./my_test -f $(IP)$(scriptdir)/gzip-scripts; then \
+				if ./my_test -f $(DESTDIR)$(scriptdir)/gzip-scripts; then \
 					gzip -f $$target; \
 				fi; \
 			fi; \
@@ -183,19 +169,19 @@
 helpdir   = $(epicdir)/help
 installhelp: installdirs
 	if ./my_test -d help ; then \
-		(cd @srcdir@/help; tar cf - .) | (cd $(IP)$(helpdir); tar xf -)  ; \
+		(cd @srcdir@/help; tar cf - .) | (cd $(DESTDIR)$(helpdir); tar xf -)  ; \
 	else \
 		echo No help files to install. ; \
 	fi
 
 installman: installdirs
-	$(INSTALL_DATA) @srcdir@/doc/epic.1 $(IP)$(mandir)/man1/$(epic).1
+	$(INSTALL_DATA) @srcdir@/doc/epic.1 $(DESTDIR)$(mandir)/man1/$(epic).1
 
 installdirs:
 	umask 022; \
-	@srcdir@/mkinstalldirs $(IP)$(epicdir) $(IP)$(scriptdir) \
-		$(IP)$(helpdir) $(IP)$(bindir) $(IP)$(libexecdir) \
-		$(IP)$(mandir)/man1
+	@srcdir@/mkinstalldirs $(DESTDIR)$(epicdir) $(DESTDIR)$(scriptdir) \
+		$(DESTDIR)$(helpdir) $(DESTDIR)$(bindir) $(DESTDIR)$(libexecdir) \
+		$(DESTDIR)$(mandir)/man1
 
 test.o: @srcdir@/test.c
 	$(CC) -c @srcdir@/test.c
Index: source/Makefile.in
--- source/Makefile.in.orig	2003-07-16 02:56:43 +0200
+++ source/Makefile.in	2006-09-17 22:57:15 +0200
@@ -28,7 +28,7 @@
 all: epic
 
 .c.o:
-	$(CC) $(CFLAGS) $(ANSIFLAGS) $(INCLUDES) -c $<
+	$(CC) $(INCLUDES) $(CFLAGS) $(ANSIFLAGS) -c $<
 
 #
 # The executables
@@ -63,15 +63,15 @@
 # .o files needing special compilation flags
 
 irc.o: Makefile ../Makefile
-	$(CC) $(CFLAGS) $(ANSIFLAGS) $(INCLUDES) -c @srcdir@/irc.c      \
+	$(CC) $(INCLUDES) $(CFLAGS) $(ANSIFLAGS) -c @srcdir@/irc.c      \
 	-DIRCLIB=\"$(IRCLIB)/\"
 
 vars.o: Makefile ../Makefile
-	$(CC) $(CFLAGS) $(ANSIFLAGS) $(INCLUDES) -c @srcdir@/vars.c   \
+	$(CC) $(INCLUDES) $(CFLAGS) $(ANSIFLAGS) -c @srcdir@/vars.c   \
 	-DWSERV_PATH=\"$(INSTALL_WSERV)\"
 
 perl.o: perl.c Makefile ../Makefile
-	$(CC) $(CFLAGS) $(ansiflags) $(INCLUDES) -c @srcdir@/perl.c `perl -MExtUtils::Embed -e ccopts`
+	$(CC) $(INCLUDES) $(CFLAGS) $(ansiflags) -c @srcdir@/perl.c `perl -MExtUtils::Embed -e ccopts`
 
 
 #
