Makefile.in
author Sam Lantinga <slouken@libsdl.org>
Thu, 13 Apr 2006 13:23:56 +0000
changeset 1622 5bbfc3e20e10
parent 1603 64710b9f3eeb
child 1623 09375aed0208
permissions -rw-r--r--
Fixed bug #191
[I opted to go for a warning, since I often tweak configure.in, but don't want to rebuild the entire project]

One thing that was lost in the switch from automake to the new build system is
that there is now no rule to build configure from configure.in.

IMHO, if configure.in gets changed, then at the very least, the build system
should print out a warning (better, again IMHO, an error) about this fact.
Else, you easily forget about this when modifying configure.in.
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@1622
    49
all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
slouken@1622
    50
slouken@1622
    51
$(srcdir)/configure: $(srcdir)/configure.in
slouken@1622
    52
	@echo "Warning, configure.in is out of date"
slouken@1622
    53
	#(cd $(srcdir) && sh autogen.sh && sh configure)
slouken@1362
    54
slouken@1362
    55
Makefile: $(srcdir)/Makefile.in
slouken@1362
    56
	$(SHELL) config.status $@
slouken@1362
    57
slouken@1362
    58
$(objects):
slouken@1391
    59
	$(SHELL) $(auxdir)/mkinstalldirs $@
slouken@1362
    60
slouken@1362
    61
.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
    62
depend:
slouken@1419
    63
	@SOURCES="$(SOURCES)" INCLUDE="$(INCLUDE)" objects="$(objects)" output="$(depend)" \
slouken@1391
    64
	$(SHELL) $(auxdir)/makedep.sh
slouken@1419
    65
	@for src in $(SDLMAIN_SOURCES); do \
slouken@1397
    66
	    obj=`echo $$src | sed -e 's|.*/||' -e 's|\.[^\.]*$$|.o|'`; \
slouken@1397
    67
	    echo "$(objects)/$$obj: $$src" >>$(depend); \
slouken@1522
    68
	    echo "	\$$(CC) \$$(CFLAGS) \$$(EXTRA_CFLAGS) -c $$src -o \$$@" >>$(depend); \
slouken@1397
    69
	done
slouken@1362
    70
slouken@1362
    71
include $(depend)
slouken@1362
    72
slouken@1362
    73
$(objects)/$(TARGET): $(OBJECTS)
slouken@1521
    74
	$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
slouken@1362
    75
slouken@1397
    76
$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
slouken@1419
    77
	$(AR) cru $@ $(SDLMAIN_OBJECTS)
slouken@1419
    78
	$(RANLIB) $@
slouken@1397
    79
slouken@1362
    80
install: install-bin install-hdrs install-lib install-data install-man
slouken@1362
    81
install-bin:
slouken@1391
    82
	$(SHELL) $(auxdir)/mkinstalldirs $(bindir)
slouken@1476
    83
	$(INSTALL) -m 755 sdl-config $(bindir)/sdl-config
slouken@1362
    84
install-hdrs:
slouken@1391
    85
	$(SHELL) $(auxdir)/mkinstalldirs $(includedir)/SDL
slouken@1362
    86
	for src in $(srcdir)/include/*.h; do \
slouken@1362
    87
	    file=`echo $$src | sed -e 's|^.*/||'`; \
slouken@1394
    88
	    $(INSTALL) -m 644 $$src $(includedir)/SDL/$$file; \
slouken@1362
    89
	done
slouken@1394
    90
	$(INSTALL) -m 644 include/SDL_config.h $(includedir)/SDL/SDL_config.h
slouken@1362
    91
install-lib:
slouken@1391
    92
	$(SHELL) $(auxdir)/mkinstalldirs $(libdir)
slouken@1362
    93
	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(libdir)/$(TARGET)
slouken@1397
    94
	$(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(libdir)/$(SDLMAIN_TARGET)
slouken@1419
    95
	$(RANLIB) $(libdir)/$(SDLMAIN_TARGET)
slouken@1362
    96
install-data:
slouken@1391
    97
	$(SHELL) $(auxdir)/mkinstalldirs $(datadir)/aclocal
slouken@1394
    98
	$(INSTALL) -m 644 $(srcdir)/sdl.m4 $(datadir)/aclocal/sdl.m4
slouken@1362
    99
install-man:
slouken@1391
   100
	$(SHELL) $(auxdir)/mkinstalldirs $(mandir)/man3
slouken@1362
   101
	for src in $(srcdir)/docs/man3/*.3; do \
slouken@1362
   102
	    file=`echo $$src | sed -e 's|^.*/||'`; \
slouken@1394
   103
	    $(INSTALL) -m 644 $$src $(mandir)/man3/$$file; \
slouken@1362
   104
	done
slouken@1362
   105
slouken@1603
   106
uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-man
slouken@1362
   107
uninstall-bin:
slouken@1362
   108
	rm -f $(bindir)/sdl-config
slouken@1362
   109
uninstall-hdrs:
slouken@1362
   110
	for src in $(srcdir)/include/*.h; do \
slouken@1362
   111
	    file=`echo $$src | sed -e 's|^.*/||'`; \
slouken@1362
   112
	    rm -f $(includedir)/SDL/$$file; \
slouken@1362
   113
	done
slouken@1362
   114
	rm -f $(includedir)/SDL/SDL_config.h
slouken@1603
   115
	-rmdir $(includedir)/SDL
slouken@1362
   116
uninstall-lib:
slouken@1362
   117
	$(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(TARGET)
slouken@1397
   118
	rm -f $(libdir)/$(SDLMAIN_TARGET)
slouken@1362
   119
uninstall-data:
slouken@1362
   120
	rm -f $(datadir)/aclocal/sdl.m4
slouken@1362
   121
uninstall-man:
slouken@1362
   122
	for src in $(srcdir)/docs/man3/*.3; do \
slouken@1362
   123
	    file=`echo $$src | sed -e 's|^.*/||'`; \
slouken@1362
   124
	    rm -f $(mandir)/man3/$$file; \
slouken@1362
   125
	done
slouken@1362
   126
slouken@1362
   127
clean:
slouken@1362
   128
	rm -rf $(objects)
slouken@1380
   129
	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
slouken@1362
   130
slouken@1362
   131
distclean: clean
slouken@1362
   132
	rm -f Makefile include/SDL_config.h sdl-config
slouken@1603
   133
	rm -f include/SDL_config.h sdl-config
slouken@1362
   134
	rm -f SDL.qpg
slouken@1362
   135
	rm -f config.status config.cache config.log libtool $(depend)
slouken@1362
   136
	rm -rf $(srcdir)/autom4te*
slouken@1603
   137
	find $(srcdir) \( \
slouken@1603
   138
	    -name '*~' -o \
slouken@1603
   139
	    -name '*.bak' -o \
slouken@1603
   140
	    -name '*.old' -o \
slouken@1603
   141
	    -name '*.rej' -o \
slouken@1603
   142
	    -name '*.orig' -o \
slouken@1603
   143
	    -name '.#*' \) \
slouken@1362
   144
	    -exec rm -f {} \;
slouken@1603
   145
	cp $(srcdir)/include/SDL_config.h.default $(srcdir)/include/SDL_config.h
slouken@1380
   146
	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
slouken@1362
   147
slouken@1362
   148
dist $(distfile):
slouken@1391
   149
	$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
slouken@1362
   150
	tar cf - $(DIST) | (cd $(distdir); tar xf -)
slouken@1603
   151
	cp $(distdir)/include/SDL_config.h.default $(distdir)/include/SDL_config.h
slouken@1362
   152
	rm -rf `find $(distdir) -name CVS`
slouken@1382
   153
	rm -f `find $(distdir) -name '.cvsignore'`
slouken@1362
   154
	rm -f `find $(distdir) -name '.#*'`
slouken@1397
   155
	rmdir `find $(distdir) -type d -empty`
slouken@1362
   156
	tar cvf - $(distdir) | gzip --best >$(distfile)
slouken@1362
   157
	rm -rf $(distdir)
slouken@1362
   158
slouken@1362
   159
rpm: $(distfile)
slouken@1362
   160
	rpmbuild -ta $?
slouken@1424
   161
slouken@1424
   162
# Create a CVS snapshot that people can run update -d on
slouken@1424
   163
CVSROOT = :pserver:guest@libsdl.org:/home/sdlweb/libsdl.org/cvs
slouken@1424
   164
snapshot:
slouken@1424
   165
	cvs -d $(CVSROOT) login
slouken@1424
   166
	cvs -d $(CVSROOT) checkout -P SDL12
slouken@1424
   167
	(cd SDL12 && ./autogen.sh && rm -rf autom4te.cache)
slouken@1603
   168
	cp SDL12/include/SDL_config.h.default SDL12/include/SDL_config.h
slouken@1424
   169
	mv SDL12 SDL-1.2
slouken@1448
   170
	tar zcf $(HOME)/SDL-1.2.tar.gz SDL-1.2
slouken@1451
   171
	rm -f $(HOME)/SDL-1.2.zip
slouken@1448
   172
	zip -r $(HOME)/SDL-1.2.zip SDL-1.2
slouken@1424
   173
	rm -rf SDL-1.2