Makefile.in
author Sam Lantinga <slouken@libsdl.org>
Thu, 23 Mar 2006 21:28:33 +0000
changeset 1603 64710b9f3eeb
parent 1580 dc4bcfeb927e
child 1622 5bbfc3e20e10
permissions -rw-r--r--
Fixed bug #171
SDL_config.h is no longer in CVS. Instead, configure will generate it for
systems that use configure, and we always copy SDL_config.h.default to
SDL_config.h before generating a snapshot or release archive.

Also fixed a couple of uninstall issues.
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@1521
    24
EXTRA_CFLAGS = @EXTRA_CFLAGS@
slouken@1393
    25
LDFLAGS = @BUILD_LDFLAGS@
slouken@1521
    26
EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
slouken@1362
    27
LIBTOOL = @LIBTOOL@
slouken@1362
    28
INSTALL = @INSTALL@
slouken@1362
    29
NASM	= @NASM@ @NASMFLAGS@
slouken@1419
    30
AR	= @AR@
slouken@1419
    31
RANLIB	= @RANLIB@
slouken@1362
    32
slouken@1362
    33
TARGET  = libSDL.la
slouken@1362
    34
SOURCES = @SOURCES@
slouken@1362
    35
OBJECTS = @OBJECTS@
slouken@1362
    36
slouken@1397
    37
SDLMAIN_TARGET = libSDLmain.a
slouken@1397
    38
SDLMAIN_SOURCES = @SDLMAIN_SOURCES@
slouken@1397
    39
SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
slouken@1397
    40
slouken@1580
    41
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.minimal Makefile.in MPWmake.sea.bin 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 Xcode.tar.gz
slouken@1362
    42
slouken@1362
    43
LT_AGE      = @LT_AGE@
slouken@1362
    44
LT_CURRENT  = @LT_CURRENT@
slouken@1362
    45
LT_RELEASE  = @LT_RELEASE@
slouken@1362
    46
LT_REVISION = @LT_REVISION@
slouken@1362
    47
LT_LDFLAGS  = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
slouken@1362
    48
slouken@1401
    49
all: Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
slouken@1362
    50
slouken@1362
    51
Makefile: $(srcdir)/Makefile.in
slouken@1362
    52
	$(SHELL) config.status $@
slouken@1362
    53
slouken@1362
    54
$(objects):
slouken@1391
    55
	$(SHELL) $(auxdir)/mkinstalldirs $@
slouken@1362
    56
slouken@1362
    57
.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
    58
depend:
slouken@1419
    59
	@SOURCES="$(SOURCES)" INCLUDE="$(INCLUDE)" objects="$(objects)" output="$(depend)" \
slouken@1391
    60
	$(SHELL) $(auxdir)/makedep.sh
slouken@1419
    61
	@for src in $(SDLMAIN_SOURCES); do \
slouken@1397
    62
	    obj=`echo $$src | sed -e 's|.*/||' -e 's|\.[^\.]*$$|.o|'`; \
slouken@1397
    63
	    echo "$(objects)/$$obj: $$src" >>$(depend); \
slouken@1522
    64
	    echo "	\$$(CC) \$$(CFLAGS) \$$(EXTRA_CFLAGS) -c $$src -o \$$@" >>$(depend); \
slouken@1397
    65
	done
slouken@1362
    66
slouken@1362
    67
include $(depend)
slouken@1362
    68
slouken@1362
    69
$(objects)/$(TARGET): $(OBJECTS)
slouken@1521
    70
	$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
slouken@1362
    71
slouken@1397
    72
$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
slouken@1419
    73
	$(AR) cru $@ $(SDLMAIN_OBJECTS)
slouken@1419
    74
	$(RANLIB) $@
slouken@1397
    75
slouken@1362
    76
install: install-bin install-hdrs install-lib install-data install-man
slouken@1362
    77
install-bin:
slouken@1391
    78
	$(SHELL) $(auxdir)/mkinstalldirs $(bindir)
slouken@1476
    79
	$(INSTALL) -m 755 sdl-config $(bindir)/sdl-config
slouken@1362
    80
install-hdrs:
slouken@1391
    81
	$(SHELL) $(auxdir)/mkinstalldirs $(includedir)/SDL
slouken@1362
    82
	for src in $(srcdir)/include/*.h; do \
slouken@1362
    83
	    file=`echo $$src | sed -e 's|^.*/||'`; \
slouken@1394
    84
	    $(INSTALL) -m 644 $$src $(includedir)/SDL/$$file; \
slouken@1362
    85
	done
slouken@1394
    86
	$(INSTALL) -m 644 include/SDL_config.h $(includedir)/SDL/SDL_config.h
slouken@1362
    87
install-lib:
slouken@1391
    88
	$(SHELL) $(auxdir)/mkinstalldirs $(libdir)
slouken@1362
    89
	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(libdir)/$(TARGET)
slouken@1397
    90
	$(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(libdir)/$(SDLMAIN_TARGET)
slouken@1419
    91
	$(RANLIB) $(libdir)/$(SDLMAIN_TARGET)
slouken@1362
    92
install-data:
slouken@1391
    93
	$(SHELL) $(auxdir)/mkinstalldirs $(datadir)/aclocal
slouken@1394
    94
	$(INSTALL) -m 644 $(srcdir)/sdl.m4 $(datadir)/aclocal/sdl.m4
slouken@1362
    95
install-man:
slouken@1391
    96
	$(SHELL) $(auxdir)/mkinstalldirs $(mandir)/man3
slouken@1362
    97
	for src in $(srcdir)/docs/man3/*.3; do \
slouken@1362
    98
	    file=`echo $$src | sed -e 's|^.*/||'`; \
slouken@1394
    99
	    $(INSTALL) -m 644 $$src $(mandir)/man3/$$file; \
slouken@1362
   100
	done
slouken@1362
   101
slouken@1603
   102
uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-man
slouken@1362
   103
uninstall-bin:
slouken@1362
   104
	rm -f $(bindir)/sdl-config
slouken@1362
   105
uninstall-hdrs:
slouken@1362
   106
	for src in $(srcdir)/include/*.h; do \
slouken@1362
   107
	    file=`echo $$src | sed -e 's|^.*/||'`; \
slouken@1362
   108
	    rm -f $(includedir)/SDL/$$file; \
slouken@1362
   109
	done
slouken@1362
   110
	rm -f $(includedir)/SDL/SDL_config.h
slouken@1603
   111
	-rmdir $(includedir)/SDL
slouken@1362
   112
uninstall-lib:
slouken@1362
   113
	$(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(TARGET)
slouken@1397
   114
	rm -f $(libdir)/$(SDLMAIN_TARGET)
slouken@1362
   115
uninstall-data:
slouken@1362
   116
	rm -f $(datadir)/aclocal/sdl.m4
slouken@1362
   117
uninstall-man:
slouken@1362
   118
	for src in $(srcdir)/docs/man3/*.3; do \
slouken@1362
   119
	    file=`echo $$src | sed -e 's|^.*/||'`; \
slouken@1362
   120
	    rm -f $(mandir)/man3/$$file; \
slouken@1362
   121
	done
slouken@1362
   122
slouken@1362
   123
clean:
slouken@1362
   124
	rm -rf $(objects)
slouken@1380
   125
	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
slouken@1362
   126
slouken@1362
   127
distclean: clean
slouken@1362
   128
	rm -f Makefile include/SDL_config.h sdl-config
slouken@1603
   129
	rm -f include/SDL_config.h sdl-config
slouken@1362
   130
	rm -f SDL.qpg
slouken@1362
   131
	rm -f config.status config.cache config.log libtool $(depend)
slouken@1362
   132
	rm -rf $(srcdir)/autom4te*
slouken@1603
   133
	find $(srcdir) \( \
slouken@1603
   134
	    -name '*~' -o \
slouken@1603
   135
	    -name '*.bak' -o \
slouken@1603
   136
	    -name '*.old' -o \
slouken@1603
   137
	    -name '*.rej' -o \
slouken@1603
   138
	    -name '*.orig' -o \
slouken@1603
   139
	    -name '.#*' \) \
slouken@1362
   140
	    -exec rm -f {} \;
slouken@1603
   141
	cp $(srcdir)/include/SDL_config.h.default $(srcdir)/include/SDL_config.h
slouken@1380
   142
	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
slouken@1362
   143
slouken@1362
   144
dist $(distfile):
slouken@1391
   145
	$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
slouken@1362
   146
	tar cf - $(DIST) | (cd $(distdir); tar xf -)
slouken@1603
   147
	cp $(distdir)/include/SDL_config.h.default $(distdir)/include/SDL_config.h
slouken@1362
   148
	rm -rf `find $(distdir) -name CVS`
slouken@1382
   149
	rm -f `find $(distdir) -name '.cvsignore'`
slouken@1362
   150
	rm -f `find $(distdir) -name '.#*'`
slouken@1397
   151
	rmdir `find $(distdir) -type d -empty`
slouken@1362
   152
	tar cvf - $(distdir) | gzip --best >$(distfile)
slouken@1362
   153
	rm -rf $(distdir)
slouken@1362
   154
slouken@1362
   155
rpm: $(distfile)
slouken@1362
   156
	rpmbuild -ta $?
slouken@1424
   157
slouken@1424
   158
# Create a CVS snapshot that people can run update -d on
slouken@1424
   159
CVSROOT = :pserver:guest@libsdl.org:/home/sdlweb/libsdl.org/cvs
slouken@1424
   160
snapshot:
slouken@1424
   161
	cvs -d $(CVSROOT) login
slouken@1424
   162
	cvs -d $(CVSROOT) checkout -P SDL12
slouken@1424
   163
	(cd SDL12 && ./autogen.sh && rm -rf autom4te.cache)
slouken@1603
   164
	cp SDL12/include/SDL_config.h.default SDL12/include/SDL_config.h
slouken@1424
   165
	mv SDL12 SDL-1.2
slouken@1448
   166
	tar zcf $(HOME)/SDL-1.2.tar.gz SDL-1.2
slouken@1451
   167
	rm -f $(HOME)/SDL-1.2.zip
slouken@1448
   168
	zip -r $(HOME)/SDL-1.2.zip SDL-1.2
slouken@1424
   169
	rm -rf SDL-1.2