Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Piatok, 19. apríl 2024

Súbor: [Platon] / games / mines / Makefile (stiahnutie)

Revízia 1.18, Thu Sep 16 13:44:21 2004 UTC (19 years, 7 months ago) by nepto


Zmeny od 1.17: +3 -1 [lines]

Added MS-Dos and Win32 makefiles into distribution.

# 
# $Platon: games/mines/Makefile,v 1.17 2004/09/16 13:41:06 nepto Exp $
#

PACKAGE = mines
VERSION = 4.3

# Directories {{{

srcdir       = .
top_srcdir   = .
distdir      = $(PACKAGE)-$(VERSION)
top_distdir  = $(distdir)
top_builddir = .

# }}} Directories

# Programs {{{

TAR      = tar
ZIP      = zip
ZIP_ENV  = -r9
GZIP_ENV = --best

CC       = gcc
CPP      =
CXX      =
#DEBUG_FLAGS = -g -ggdb -DDEBUG=1
CFLAGS   = -O3 -pedantic -Wall $(DEBUG_FLAGS)
CPPFLAGS =
LDFLAGS  =
INCLUDES = -I_shared

SVGALIB_DEFS    = -DPLATON_SYSTEM_SVGALIB -DPACKAGE='"$(PACKAGE)"' -DVERSION='"$(VERSION)-svgalib"'
SVGALIB_LIBS    = -lvgagl -lvga -lm
SVGALIB_COMPILE = $(CC) $(SVGALIB_DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
SVGALIB_CCLD    = $(CC)
SVGALIB_LINK    = $(SVGALIB_CCLD) $(CFLAGS) $(LDFLAGS) -o $@

X11_DEFS    = -DPLATON_SYSTEM_X11 -DPACKAGE='"$(PACKAGE)"' -DVERSION='"$(VERSION)-x11"'
X11_LIBS    = -L/usr/X11R6/lib -lX11
X11_COMPILE = $(CC) $(X11_DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
X11_CCLD    = $(CC)
X11_LINK    = $(X11_CCLD) $(CFLAGS) $(LDFLAGS) -o $@

# }}} Programs

SVGALIB_OBJECTS = hiscore.o mines.o dos2linux.o my-graph.o mouse.o standart.o menu.o
X11_OBJECTS = hiscore.xo mines.xo dos2linux.xo my-graph.xo mouse.xo standart.xo menu.xo x11-bgi.xo

prefix = /usr/local
bindir = $(prefix)/games

DISTFILES = Makefile \
            Makefile.dos \
            Makefile.win \
            hiscore.c \
            hiscore.h \
            mines.c \
            doc/ \
            doc/file_id.diz \
            doc/mines.sig \
            _shared/ \
            _shared/dos2linux.c \
            _shared/dos2linux.h \
            _shared/dos2win32.c \
            _shared/dos2win32.h \
            _shared/fontlib.c \
            _shared/macros.h \
            _shared/menu.c \
            _shared/menu.h \
            _shared/mouse-svgalib.c \
            _shared/mouse-win32.c \
            _shared/mouse-x11.c \
            _shared/mouse.c \
            _shared/mouse.h \
            _shared/my-graph.c \
            _shared/my-graph.h \
            _shared/standart-linux.c \
            _shared/standart-win32.c \
            _shared/standart.c \
            _shared/standart.h \
            _shared/stshared.c \
            _shared/system.h \
            _shared/typedef.h \
            _shared/winbgim.cpp \
            _shared/winbgim.h \
            _shared/x11-bgi.c \
            _shared/x11-bgi.h

all:
    @echo Available targets:
    @echo - msdos: makes MS-Dos executable
    @echo - msdos-clean: cleans MS-Dos working files
    @echo - win32: makes MS-Windows 32-bit executable
    @echo - win32-clean: cleans MS-Windows working files
    @echo - svgalib: makes SVGAlib Linux binary
    @echo - svgalib-clean: cleans SVGAlib Linux working files
    @echo - x11: makes X Windows System binary
    @echo - x11-clean: cleans X Windows System working files

msdos:
    make -DPACKAGE="$(PACKAGE)" -DVERSION="$(VERSION)-msdos" -f Makefile.dos

msdos-clean:
    make -DPACKAGE="$(PACKAGE)" -DVERSION="$(VERSION)-msdos" -f Makefile.dos clean

win32:
    nmake -D PACKAGE="$(PACKAGE)" -D VERSION="$(VERSION)-win32" -f Makefile.win

win32-clean:
    nmake -D PACKAGE="$(PACKAGE)" -D VERSION="$(VERSION)-win32" -f Makefile.win clean

svgalib: unix-shared-test $(SVGALIB_OBJECTS)
    $(CC) $(CFLAGS) -o mines $(SVGALIB_OBJECTS) $(SVGALIB_LIBS)

svgalib-clean:
    -rm -f mines $(SVGALIB_OBJECTS)

x11: unix-shared-test $(X11_OBJECTS)
    $(CC) $(CFLAGS) -o xmines $(X11_OBJECTS) $(X11_LIBS)

x11-clean:
    -rm -f xmines $(X11_OBJECTS)

unix-shared-test:
    @if test ! -d _shared; then                                                \
        if test -d ../_shared; then                                            \
            ln -s ../_shared _shared;                                        \
            echo -n "warning: ";                                            \
            echo "shared directory did not exist, thus it was symlinked";    \
        else                                                                \
            echo -n "error: ";                                                \
            echo "shared directory does not exist and cannot be symlinked";    \
            exit 1;                                                            \
        fi;                                                                    \
    fi

#
# svgalib target objects
#

hiscore.o: Makefile hiscore.c hiscore.h
    $(SVGALIB_COMPILE) -c hiscore.c -o hiscore.o

mines.o: Makefile mines.c
    $(SVGALIB_COMPILE) -c mines.c -o mines.o

dos2linux.o: Makefile _shared/dos2linux.c _shared/dos2linux.h
    $(SVGALIB_COMPILE) -c _shared/dos2linux.c -o dos2linux.o

my-graph.o: Makefile _shared/my-graph.c _shared/my-graph.h
    $(SVGALIB_COMPILE) -c _shared/my-graph.c -o my-graph.o

mouse.o: Makefile _shared/mouse-svgalib.c _shared/mouse.h
    $(SVGALIB_COMPILE) -c _shared/mouse-svgalib.c -o mouse.o

standart.o: Makefile _shared/stshared.c _shared/standart-linux.c _shared/standart.h
    $(SVGALIB_COMPILE) -c _shared/standart-linux.c -o standart.o

menu.o: Makefile _shared/menu.c _shared/menu.h
    $(SVGALIB_COMPILE) -c _shared/menu.c -o menu.o

#
# x11 target objects
#

hiscore.xo: Makefile hiscore.c hiscore.h
    $(X11_COMPILE) -c hiscore.c -o hiscore.xo

mines.xo: Makefile mines.c
    $(X11_COMPILE) -c mines.c -o mines.xo

x11-bgi.xo: Makefile _shared/x11-bgi.c _shared/x11-bgi.h
    $(X11_COMPILE) -c _shared/x11-bgi.c -o x11-bgi.xo

dos2linux.xo: Makefile _shared/dos2linux.c _shared/dos2linux.h
    $(X11_COMPILE) -c _shared/dos2linux.c -o dos2linux.xo

my-graph.xo: Makefile _shared/my-graph.c _shared/my-graph.h
    $(X11_COMPILE) -c _shared/my-graph.c -o my-graph.xo

mouse.xo: Makefile _shared/mouse-x11.c _shared/mouse.h
    $(X11_COMPILE) -c _shared/mouse-x11.c -o mouse.xo

standart.xo: Makefile _shared/stshared.c _shared/standart-linux.c _shared/standart.h
    $(X11_COMPILE) -c _shared/standart-linux.c -o standart.xo

menu.xo: Makefile _shared/menu.c _shared/menu.h
    $(X11_COMPILE) -c _shared/menu.c -o menu.xo

# Distribution targets {{{
dist: unix-shared-test distdir
    GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
    ZIP=$(ZIP_ENV) $(ZIP) $(distdir).zip $(distdir)
    -rm -rf $(distdir)

dist-all: distdir
    GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
    ZIP=$(ZIP_ENV) $(ZIP) $(distdir).zip $(distdir)
    -rm -rf $(distdir)

distdir: $(DISTFILES)
    -rm -rf $(distdir)
    mkdir $(distdir)
    @here=`cd $(top_builddir) && pwd`; \
    top_distdir=`cd $(distdir) && pwd`; \
    distdir=`cd $(distdir) && pwd`;
    @FILES=`echo "$(DISTFILES)" | awk 'BEGIN{RS=" "}{print}' | sort -u`; \
    for file in $$FILES; do \
      d=$(srcdir); \
      if test -d $$d/$$file; then \
        mkdir $(distdir)/$$file; \
      else \
        test -f $(distdir)/$$file \
        || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
        || cp -p $$d/$$file $(distdir)/$$file || :; \
      fi; \
    done

# }}}

# vim600: fdm=marker fdc=3


Platon Group <platon@platon.sk> http://platon.sk/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok