Makefile.in
author Sam Lantinga <slouken@libsdl.org>
Sun, 26 Feb 2006 19:30:21 +0000
changeset 1442 e3242177fe4a
parent 1424 7a610f25c12f
child 1448 9a845c7b8b35
permissions -rw-r--r--
Updated OS/2 build, yay!
slouken@1362
     1
# Makefile to build and install the SDL library
slouken@1362
     2
slouken@1362
     3
top_builddir = .
slouken@1362
     4
srcdir  = @srcdir@
slouken@1362
     5
objects = build
slouken@1362
     6
depend	= build-deps
slouken@1362
     7
prefix = @prefix@
slouken@1362
     8
exec_prefix = @exec_prefix@
slouken@1390
     9
bindir	= $(DESTDIR)@bindir@
slouken@1390
    10
libdir  = $(DESTDIR)@libdir@
slouken@1390
    11
includedir = $(DESTDIR)@includedir@
slouken@1390
    12
datadir	= $(DESTDIR)@datadir@
slouken@1390
    13
mandir	= $(DESTDIR)@mandir@
slouken@1391
    14
auxdir	= @ac_aux_dir@
slouken@1362
    15
distpath = $(srcdir)/..
slouken@1362
    16
distdir = SDL-@SDL_VERSION@
slouken@1362
    17
distfile = $(distdir).tar.gz
slouken@1362
    18
slouken@1380
    19
@SET_MAKE@
slouken@1362
    20
SHELL	= @SHELL@
slouken@1362
    21
CC      = @CC@
slouken@1362
    22
INCLUDE = @INCLUDE@
slouken@1362
    23
CFLAGS  = @BUILD_CFLAGS@
slouken@1393
    24
LDFLAGS = @BUILD_LDFLAGS@
slouken@1362
    25
LIBTOOL = @LIBTOOL@
slouken@1362
    26
INSTALL = @INSTALL@
slouken@1362
    27
NASM	= @NASM@ @NASMFLAGS@
slouken@1419
    28
AR	= @AR@
slouken@1419
    29
RANLIB	= @RANLIB@
slouken@1362
    30
slouken@1362
    31
TARGET  = libSDL.la
slouken@1362
    32
SOURCES = @SOURCES@
slouken@1362
    33
OBJECTS = @OBJECTS@
slouken@1362
    34
slouken@1397
    35
SDLMAIN_TARGET = libSDLmain.a
slouken@1397
    36
SDLMAIN_SOURCES = @SDLMAIN_SOURCES@
slouken@1397
    37
SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
slouken@1397
    38
slouken@1442
    39
DIST = acinclude.m4 autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS CWprojects.sea.bin docs docs.html EpocBuildFiles.zip include INSTALL Makefile.dc Makefile.in MPWmake.sea.bin PBProjects.tar.gz README* sdl-config.in sdl.m4 SDL.qpg.in SDL.spec SDL.spec.in src test TODO VisualCE.zip VisualC.html VisualC.zip Watcom-OS2.zip WhatsNew Xcode21.tar.gz Xcode.tar.gz XcodeUniversal.tar.gz
slouken@1362
    40
slouken@1362
    41
LT_AGE      = @LT_AGE@
slouken@1362
    42
LT_CURRENT  = @LT_CURRENT@
slouken@1362
    43
LT_RELEASE  = @LT_RELEASE@
slouken@1362
    44
LT_REVISION = @LT_REVISION@
slouken@1362
    45
LT_LDFLAGS  = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
slouken@1362
    46
slouken@1401
    47
all: Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
slouken@1362
    48
slouken@1362
    49
Makefile: $(srcdir)/Makefile.in
slouken@1362
    50
	$(SHELL) config.status $@
slouken@1362
    51
slouken@1362
    52
$(objects):
slouken@1391
    53
	$(SHELL) $(auxdir)/mkinstalldirs $@
slouken@1362
    54
slouken@1362
    55
.PHONY: all depend install install-bin install-hdrs install-lib install-data install-man uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-man clean distclean dist
slouken@1362
    56
depend:
slouken@1419
    57
	@SOURCES="$(SOURCES)" INCLUDE="$(INCLUDE)" objects="$(objects)" output="$(depend)" \
slouken@1391
    58
	$(SHELL) $(auxdir)/makedep.sh
slouken@1419
    59
	@for src in $(SDLMAIN_SOURCES); do \
slouken@1397
    60
	    obj=`echo $$src | sed -e 's|.*/||' -e 's|\.[^\.]*$$|.o|'`; \
slouken@1397
    61
	    echo "$(objects)/$$obj: $$src" >>$(depend); \
slouken@1397
    62
	    echo "	\$$(CC) \$$(CFLAGS) -c $$src -o \$$@" >>$(depend); \
slouken@1397
    63
	done
slouken@1362
    64
slouken@1362
    65
include $(depend)
slouken@1362
    66
slouken@1362
    67
$(objects)/$(TARGET): $(OBJECTS)
slouken@1362
    68
	$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(LIBS) $(LT_LDFLAGS)
slouken@1362
    69
slouken@1397
    70
$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
slouken@1419
    71
	$(AR) cru $@ $(SDLMAIN_OBJECTS)
slouken@1419
    72
	$(RANLIB) $@
slouken@1397
    73
slouken@1362
    74
install: install-bin install-hdrs install-lib install-data install-man
slouken@1362
    75
install-bin:
slouken@1391
    76
	$(SHELL) $(auxdir)/mkinstalldirs $(bindir)
slouken@1362
    77
	$(INSTALL) -m 755 $(srcdir)/sdl-config $(bindir)/sdl-config
slouken@1362
    78
install-hdrs:
slouken@1391
    79
	$(SHELL) $(auxdir)/mkinstalldirs $(includedir)/SDL
slouken@1362
    80
	for src in $(srcdir)/include/*.h; do \
slouken@1362
    81
	    file=`echo $$src | sed -e 's|^.*/||'`; \
slouken@1394
    82
	    $(INSTALL) -m 644 $$src $(includedir)/SDL/$$file; \
slouken@1362
    83
	done
slouken@1394
    84
	$(INSTALL) -m 644 include/SDL_config.h $(includedir)/SDL/SDL_config.h
slouken@1362
    85
install-lib:
slouken@1391
    86
	$(SHELL) $(auxdir)/mkinstalldirs $(libdir)
slouken@1362
    87
	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(libdir)/$(TARGET)
slouken@1397
    88
	$(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(libdir)/$(SDLMAIN_TARGET)
slouken@1419
    89
	$(RANLIB) $(libdir)/$(SDLMAIN_TARGET)
slouken@1362
    90
install-data:
slouken@1391
    91
	$(SHELL) $(auxdir)/mkinstalldirs $(datadir)/aclocal
slouken@1394
    92
	$(INSTALL) -m 644 $(srcdir)/sdl.m4 $(datadir)/aclocal/sdl.m4
slouken@1362
    93
install-man:
slouken@1391
    94
	$(SHELL) $(auxdir)/mkinstalldirs $(mandir)/man3
slouken@1362
    95
	for src in $(srcdir)/docs/man3/*.3; do \
slouken@1362
    96
	    file=`echo $$src | sed -e 's|^.*/||'`; \
slouken@1394
    97
	    $(INSTALL) -m 644 $$src $(mandir)/man3/$$file; \
slouken@1362
    98
	done
slouken@1362
    99
slouken@1362
   100
uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-man
slouken@1362
   101
uninstall-bin:
slouken@1362
   102
	rm -f $(bindir)/sdl-config
slouken@1362
   103
uninstall-hdrs:
slouken@1362
   104
	for src in $(srcdir)/include/*.h; do \
slouken@1362
   105
	    file=`echo $$src | sed -e 's|^.*/||'`; \
slouken@1362
   106
	    rm -f $(includedir)/SDL/$$file; \
slouken@1362
   107
	done
slouken@1362
   108
	rm -f $(includedir)/SDL/SDL_config.h
slouken@1362
   109
uninstall-lib:
slouken@1362
   110
	$(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(TARGET)
slouken@1397
   111
	rm -f $(libdir)/$(SDLMAIN_TARGET)
slouken@1362
   112
uninstall-data:
slouken@1362
   113
	rm -f $(datadir)/aclocal/sdl.m4
slouken@1362
   114
uninstall-man:
slouken@1362
   115
	for src in $(srcdir)/docs/man3/*.3; do \
slouken@1362
   116
	    file=`echo $$src | sed -e 's|^.*/||'`; \
slouken@1362
   117
	    rm -f $(mandir)/man3/$$file; \
slouken@1362
   118
	done
slouken@1362
   119
slouken@1362
   120
clean:
slouken@1362
   121
	rm -rf $(objects)
slouken@1380
   122
	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
slouken@1362
   123
slouken@1362
   124
distclean: clean
slouken@1362
   125
	rm -f Makefile include/SDL_config.h sdl-config
slouken@1362
   126
	rm -f SDL.qpg
slouken@1362
   127
	rm -f config.status config.cache config.log libtool $(depend)
slouken@1362
   128
	rm -rf $(srcdir)/autom4te*
slouken@1362
   129
	find $(srcdir) \
slouken@1362
   130
	    -name '*~' -o -name '*.bak' -o -name '*.old' -o -name '*.rej' -o \
slouken@1362
   131
	    -name '.#*' \
slouken@1362
   132
	    -exec rm -f {} \;
slouken@1362
   133
	cp include/SDL_config.h.minimal include/SDL_config.h
slouken@1380
   134
	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
slouken@1362
   135
slouken@1362
   136
dist $(distfile):
slouken@1391
   137
	$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
slouken@1362
   138
	tar cf - $(DIST) | (cd $(distdir); tar xf -)
slouken@1362
   139
	rm -rf `find $(distdir) -name CVS`
slouken@1382
   140
	rm -f `find $(distdir) -name '.cvsignore'`
slouken@1362
   141
	rm -f `find $(distdir) -name '.#*'`
slouken@1397
   142
	rmdir `find $(distdir) -type d -empty`
slouken@1362
   143
	tar cvf - $(distdir) | gzip --best >$(distfile)
slouken@1362
   144
	rm -rf $(distdir)
slouken@1362
   145
slouken@1362
   146
rpm: $(distfile)
slouken@1362
   147
	rpmbuild -ta $?
slouken@1424
   148
slouken@1424
   149
# Create a CVS snapshot that people can run update -d on
slouken@1424
   150
CVSROOT = :pserver:guest@libsdl.org:/home/sdlweb/libsdl.org/cvs
slouken@1424
   151
snapshot:
slouken@1424
   152
	cvs -d $(CVSROOT) login
slouken@1424
   153
	cvs -d $(CVSROOT) checkout -P SDL12
slouken@1424
   154
	(cd SDL12 && ./autogen.sh && rm -rf autom4te.cache)
slouken@1424
   155
	mv SDL12 SDL-1.2
slouken@1424
   156
	tar zcvf $(HOME)/SDL-1.2.tar.gz SDL-1.2
slouken@1424
   157
	rm -rf SDL-1.2