[PATCH 04/23] wmsun: Update Makefile.

Doug Torrance <[email protected]>
Newsgroups gmane.compw.window-managers.windowmaker.devel
Message-ID <[email protected]>
In particular,
- Remove INCDIR, DESTDIR, and LIBDIR definitions.
- Add PREFIX, BINDIR, MANDIR, and INSTALL definitions.
- Add -lm to LIBS.
- Drop COPTS, uname, and INCDIR and add CPPFLAGS and CFLAGS when compiling.
- Drop COPTS, SYSTEM, INCDIR, and LIBDIR and add LDFLAGS when linking.
- Use INSTALL when installing, create installation directories, use new
  BINDIR and MANDIR directories.
---
 wmsun/Makefile | 30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/wmsun/Makefile b/wmsun/Makefile
index a3709cf..81f0f67 100644
--- a/wmsun/Makefile
+++ b/wmsun/Makefile
@@ -1,35 +1,32 @@
 CC     = gcc
 CFLAGS = -O2 -Wall
-INCDIR = -I/usr/X11R6/include/X11
-DESTDIR= /usr/X11R6
-LIBDIR = -L/usr/X11R6/lib
-
-
+PREFIX = /usr/local
+BINDIR = $(PREFIX)/bin
+MANDIR = $(PREFIX)/share/man/man1
+INSTALL = install
 
 # If you need to compile on a Linux, dont change anything. If
 # compiling for Solaris, swap the LIBS below...
 #
 # For Linux (and other?) Machines...
 #
-LIBS   = -lXpm -lX11 -lXext
+LIBS   = -lXpm -lX11 -lXext -lm
 #
 # For Sun Solaris Machines (I know it compiles on 2.6)...
 #
 # LIBS   = -lXpm -lX11 -lXext -lsocket
 
-
 OBJS   = wmSun.o SunRise.o wmgeneral/wmgeneral.o
 
-
 .c.o:
-	$(CC) $(COPTS) -D$(shell echo `uname -s`) -c $< -o $*.o $(INCDIR)
-
+	$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $*.o
 
 all:	wmSun.o wmSun
 
-wmSun.o: wmSun_master.xpm wmSun_mask.xbm 
-wmSun:	$(OBJS) 
-	$(CC) $(COPTS) $(SYSTEM) -lm -o wmSun $^ $(INCDIR) $(LIBDIR) $(LIBS)
+wmSun.o: wmSun_master.xpm wmSun_mask.xbm
+
+wmSun:	$(OBJS)
+	$(CC) $(LDFLAGS) -o wmSun $^ $(LIBS)
 
 clean:
 	for i in $(OBJS) ; do \
@@ -38,6 +35,7 @@ clean:
 	rm -f wmSun
 
 install:: wmSun
-	install -s -m 0755 wmSun $(DESTDIR)/bin
-	install    -m 0644 wmSun.1 $(DESTDIR)/man/man1 
-
+	$(INSTALL) -d $(DESTDIR)$(BINDIR)
+	$(INSTALL) wmSun $(DESTDIR)$(BINDIR)
+	$(INSTALL) -d $(DESTDIR)$(MANDIR)
+	$(INSTALL) -m 644 wmSun.1 $(DESTDIR)$(MANDIR)
-- 
2.1.4


-- 
To unsubscribe, send mail to [email protected].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.