Made the Makefiles automatically regenerate themselves from Makefile.mingw if neccessary.

This commit is contained in:
Moritz Bunkus 2004-01-09 22:25:21 +00:00
parent 2b47ee4872
commit 9593a613b0
9 changed files with 36 additions and 9 deletions

View File

@ -16,14 +16,7 @@ endif
# And now the targets.
.PHONY: config.h
all: config.h subdirs
config.h:
if [ ! -f config.h ]; then \
cp config.h.mingw config.h ; \
else \
true; \
fi
all: subdirs
subdirs:
list='$(SUBDIRS)'; \
@ -39,6 +32,10 @@ clean:
(cd $$subdir && make -f Makefile.mingw clean) || exit 1; \
done
Makefile: Makefile.mingw
@echo Re-copying Makefile from Makefile.mingw
sed "s/-f Makefile\.mingw//g" < $< > $@
depend:
list='$(SUBDIRS)'; \
for subdir in $$list; do \

View File

@ -29,8 +29,10 @@ if gcc -v 2>&1 | grep -i mingw > /dev/null 2> /dev/null; then
for i in `find -name Makefile.mingw`; do
n=`echo $i | sed 's/\.mingw$//'`
echo "Creating $n from $i"
sed "s/Makefile\.mingw\([^\.]\)/Makefile\1/g" < $i > $n
sed "s/-f Makefile\.mingw//g" < $i > $n
done
echo "Creating config.h from config.h.mingw"
cp config.h.mingw config.h
echo ''
echo 'Creating dependencies (calling "make depend")'

View File

@ -30,6 +30,10 @@ libaviclasses.a: $(libaviclasses_OBJECTS)
clean:
rm -f *.o $(LIBRARIES)
Makefile: Makefile.mingw
@echo Re-copying Makefile from Makefile.mingw
sed "s/-f Makefile\.mingw//g" < $< > $@
depend:
$(CXX) $(CXXFLAGS) $(INCLUDES) $(SYSTEM_INCLUDES) -MM \
$(libaviclasses_SOURCES) > .depend

View File

@ -28,6 +28,10 @@ libavi.a: $(libavi_OBJECTS)
clean:
rm -f *.o $(LIBRARIES) .depend
Makefile: Makefile.mingw
@echo Re-copying Makefile from Makefile.mingw
sed "s/-f Makefile\.mingw//g" < $< > $@
depend:
$(CC) $(CFLAGS) $(INCLUDES) $(SYSTEM_INCLUDES) -MM \
$(libavi_SOURCES) > .depend

View File

@ -87,6 +87,10 @@ clean:
done
rm -f *.o $(PROGRAMS)
Makefile: Makefile.mingw
@echo Re-copying Makefile from Makefile.mingw
sed "s/-f Makefile\.mingw//g" < $< > $@
depend:
list='$(SUBDIRS)'; \
for subdir in $$list; do \

View File

@ -63,6 +63,10 @@ libmtxcomp.a: $(libmtxcomp_OBJECTS)
clean:
rm -f *.o $(LIBRARIES)
Makefile: Makefile.mingw
@echo Re-copying Makefile from Makefile.mingw
sed "s/-f Makefile\.mingw//g" < $< > $@
depend:
$(CXX) $(CXXFLAGS) $(INCLUDES) $(SYSTEM_INCLUDES) -MM \
$(libmtxcommon_SOURCES) $(libmtxebmlcommon_SOURCES) \

View File

@ -43,6 +43,10 @@ libmtxinput.a: $(libmtxinput_OBJECTS)
clean:
rm -f *.o $(LIBRARIES)
Makefile: Makefile.mingw
@echo Re-copying Makefile from Makefile.mingw
sed "s/-f Makefile\.mingw//g" < $< > $@
depend:
$(CXX) $(CXXFLAGS) $(INCLUDES) $(SYSTEM_INCLUDES) -MM \
$(libmtxinput_SOURCES) > .depend

View File

@ -40,6 +40,10 @@ mmg: $(mmg_OBJECTS) $(mmg_DEPENDENCIES)
clean:
rm -f *.o $(PROGRAMS)
Makefile: Makefile.mingw
@echo Re-copying Makefile from Makefile.mingw
sed "s/-f Makefile\.mingw//g" < $< > $@
depend:
$(CXX) $(CXXFLAGS) $(INCLUDES) $(SYSTEM_INCLUDES) -MM \
$(mmg_SOURCES) > .depend

View File

@ -39,6 +39,10 @@ libmtxoutput.a: $(libmtxoutput_OBJECTS)
clean:
rm -f *.o $(LIBRARIES)
Makefile: Makefile.mingw
@echo Re-copying Makefile from Makefile.mingw
sed "s/-f Makefile\.mingw//g" < $< > $@
depend:
$(CXX) $(CXXFLAGS) $(INCLUDES) $(SYSTEM_INCLUDES) -MM \
$(libmtxoutput_SOURCES) > .depend