# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-prefix = /usr
+prefix = /usr/local
exec_prefix = $(prefix)
-datadir = $(prefix)/share/games
-pkgdatadir = $(datadir)/vor
-bindir = $(exec_prefix)/games
+datarootdir = $(prefix)/share
+pkgdatadir = $(datarootdir)/vor
+bindir = $(exec_prefix)/bin
CFLAGS := -Wall -O3
LDFLAGS :=
graphics := data/ship.png data/icon.png data/life.png data/font.png $(rocks)
INSTALL := install
-INSTALL_PROGRAM := $(INSTALL) $(shell sh -c 'test "$$UID" "=" "0" && echo "-o games -g games"')
+INSTALL_PROGRAM := $(INSTALL)
INSTALL_DATA := $(INSTALL) -m 644
program: vor
%.o: %.c
- @echo compiling $@ from $<
- @$(CC) $(cflags) -c -o $@ $<
+ $(CC) $(cflags) -c -o $@ $<
$(my_objects): config.h
sprite.o: sprite.h common.h
vor: $(objects)
- @echo linking $@ from $^
- @$(CC) $^ $(ldflags) -o $@
+ $(CC) $^ $(ldflags) -o $@
include gfx.mk
rm -f $(graphics) font_guts font_guts.pov
mkinstalldirs:
- if [ ! -d $(DESTDIR)$(pkgdatadir) ]; then mkdir $(DESTDIR)$(pkgdatadir); fi
+ if [ ! -d $(DESTDIR)$(pkgdatadir) ]; then mkdir -p $(DESTDIR)$(pkgdatadir); fi
+ if [ ! -d $(DESTDIR)$(bindir) ]; then mkdir -p $(DESTDIR)$(bindir); fi
-rminstalldirs:
+rminstalldirs: uninstall-data
if [ -d $(DESTDIR)$(pkgdatadir) ]; then rmdir $(DESTDIR)$(pkgdatadir); fi
install: all mkinstalldirs install-program install-data
install-program: program
- $(INSTALL_PROGRAM) ./vor $(DESTDIR)$(bindir)
+ $(INSTALL_PROGRAM) ./vor $(DESTDIR)$(bindir)/
-install-data: data
+install-data: data mkinstalldirs
$(INSTALL_DATA) ./data/*.png $(DESTDIR)$(pkgdatadir)/
$(INSTALL_DATA) ./data/*.wav $(DESTDIR)$(pkgdatadir)/
$(INSTALL_DATA) ./data/*.xm $(DESTDIR)$(pkgdatadir)/