--- Makefile.orig 2005-12-18 03:05:08 UTC +++ Makefile @@ -2,12 +2,12 @@ # You need an ANSI C compiler. gcc is probably best. # -CC=gcc +CC?=gcc # Compiler options (and sound driver) to use. This one is for Linux, # and other OSS-using systems. # -CFLAGS=-O -Wall -DDRIVER_OSS +CFLAGS+=-Wall -DDRIVER_OSS # for OpenBSD, uncomment this: #CFLAGS=-O -Wall -DDRIVER_OPENBSD @@ -19,10 +19,10 @@ CURSES_LIB=-lncurses # dest for make install # -PREFIX=/usr/local -BINDIR=$(PREFIX)/bin +PREFIX?=/usr/local +BINDIR=$(DESTDIR)$(PREFIX)/bin XBINDIR=$(BINDIR) -MANDIR=$(PREFIX)/man/man1 +MANDIR=$(DESTDIR)$(PREFIX)/share/man/man1 # if you want the X version to be installed in the usual X executables # directory, uncomment this (altering if necessary): @@ -37,25 +37,27 @@ XOBJS=main.o sound.o uigtk.o z80.o drv-oss.o drv-obsd. OBJS=main.o sound.o ui.o z80.o drv-oss.o drv-obsd.o XOBJS=main.o sound.o uigtk.o z80.o drv-oss.o drv-obsd.o +GTK_CFLAGS+= `pkg-config --cflags gtk+-2.0` -DGTK2 +GTK_LDFLAGS+= `pkg-config --libs gtk+-2.0` -DGTK2 + all: aylet xaylet aylet: $(OBJS) - $(CC) -o aylet $(OBJS) $(CURSES_LIB) + $(CC) $(LDFLAGS) $(CFLAGS) -o aylet $(OBJS) $(CURSES_LIB) xaylet: $(XOBJS) - $(CC) -o xaylet $(XOBJS) `gtk-config --libs` + $(CC) $(GTK_CFLAGS) $(GTK_LDFLAGS) $(LDFLAGS) $(CFLAGS) -o xaylet $(XOBJS) uigtk.o: uigtk.c - $(CC) $(CFLAGS) `gtk-config --cflags` -c uigtk.c -o uigtk.o + $(CC) $(GTK_CFLAGS) $(CFLAGS) $(LDFLAGS) -c uigtk.c -o uigtk.o installdirs: /bin/sh ./mkinstalldirs $(BINDIR) $(XBINDIR) $(MANDIR) install: installdirs - if [ -f aylet ]; then install -m 755 aylet $(BINDIR); fi - if [ -f xaylet ]; then install -m 755 xaylet $(XBINDIR); fi + if [ -f aylet ]; then strip aylet; install -m 755 aylet $(BINDIR); fi + if [ -f xaylet ]; then strip xaylet; install -m 755 xaylet $(XBINDIR); fi install -m 644 aylet.1 $(MANDIR) - ln -sf $(MANDIR)/aylet.1 $(MANDIR)/xaylet.1 uninstall: $(RM) $(BINDIR)/aylet $(XBINDIR)/xaylet