X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=MakeTargets;h=fea561feb4c7a9b2ea7d590591cf9bf8e45844dc;hb=4aea4687bce3f9e1fbbf7b6ab0ae4a57f2418fe9;hp=6b1cc7b6f577d2ae678d50dbf7249656cfb1e3c3;hpb=544e945d851bf69e520a6d675bbc7e31f8919320;p=libfirm diff --git a/MakeTargets b/MakeTargets index 6b1cc7b6f..fea561feb 100644 --- a/MakeTargets +++ b/MakeTargets @@ -1,8 +1,13 @@ -# Hey Emacs, this is a -*- makefile -*- # -# libFIRM Project -# -# $Id$ +# Project: libFIRM +# File name: MakeTargets +# Purpose: +# Author: nicht Till Riedel, das waren andere +# Modified by: +# Created: +# CVS-ID: $Id$ +# Copyright: (c) 2002-2003 Universität Karlsruhe +# Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. # .PHONY: subdir_all @@ -11,8 +16,12 @@ all : subdir_all # partial linking of a subdir's $(OFILES) into one file subdir.o: $(OFILES) +ifeq ($(strip $(OFILES)),) + >$@ +else rm -f $@ - $(LD) $(LDFLAGS) -r -o $@ $^ + $(LD) $(LDFLAGS) -r -o $@ $^ +endif clean: subdir_clean local_clean .PHONY: local_clean @@ -20,7 +29,7 @@ local_clean: $(RM) $(OFILES) subdir.o core realclean: subdir_realclean local_clean - $(RM) $(GENFILES) .depend TAGS + $(RM) $(GENFILES) .depend TAGS $(TARDIRNAME) depend: subdir_depend local_depend .PHONY: local_depend @@ -32,6 +41,21 @@ else endif +# generate an archive for distribution +distrib: dist + $(MAKE) -C testprograms dist + +dist: subdir_dist local_dist $(TARDIRNAME) +# @echo create archive with $(DISTFILES) +# @echo tar -C $(top_srcdir) -uf libfirm.tar $(ARCHIVEDISTFILES) + $(TAR) $(TARFLAGS) $(ARCHIVEDISTFILES) +.PHONY: local_dist +local_dist: $(DISTFILES) + +$(TARDIRNAME): + $(LN_S) $(top_srcdir) $@ + +# dont know about this # Recurse into $(subdirs) for $(targets) $(addprefix subdir_,$(targets)): $(subdirs) +$(recurse) @@ -41,20 +65,58 @@ Makefile: $(srcdir)/Makefile.in $(topdir)/config.status CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status >&2 # generate TAGS -tags: subdir_tags local_tags -.PHONY: local_tags -local_tags: $(TAGFILES) - etags -C $^ +.PHONY: tags +tags: TAGS +TAGS: + ctags -R *.[ch] # installation -install: subdir_install local_install -local_install: +install: $(INCLUDEDIR) $(INCLUDEDIR)/adt install_headers $(LIBDIR) install_libs + @echo ================================================ + @echo Don\'t forget to add $(LIBDIR) to LD_LIBRARY_PATH + @echo Don\'t forget to add /usr/public/libxml2/lib to LD_LIBRARY_PATH + @echo ================================================ + +install_headers: subdir_install_headers local_install_headers +local_install_headers: ifneq ($(strip $(INSTALL_HEADERS)),) - $(INSTALL) -m u+rw,a+r $(addprefix $(srcdir)/,$(INSTALL_HEADERS)) $(INCLUDEDIR) + $(INSTALL) -m u+rw,a+r $(addprefix $(srcdir)/,$(INSTALL_HEADERS)) $(INCLUDEDIR) +endif +ifneq ($(strip $(INSTALL_GENERATED_HEADERS)),) + $(INSTALL) -m u+rw,a+r $(INSTALL_GENERATED_HEADERS) $(INCLUDEDIR) endif +ifneq ($(strip $(INSTALL_HEADERS_ADT)),) + $(INSTALL) -m u+rw,a+r $(addprefix $(srcdir)/,$(INSTALL_HEADERS_ADT)) $(INCLUDEDIR)/adt +endif + +install_libs: subdir_install_libs local_install_libs +local_install_libs: ifneq ($(strip $(INSTALL_LIBS)),) - $(INSTALL) -m u+rw,a+r $(addprefix $(topdir)/,$(INSTALL_LIBS)) $(LIBDIR) + $(INSTALL) -m u+rw,a+r $(addprefix $(topdir)/,$(INSTALL_LIBS)) $(LIBDIR) + @# the '.a' is ranlib'ed already, and the '.so' doesn't need ranlib-ing + @# $(RANLIB) $(addprefix $(LIBDIR)/,$(INSTALL_LIBS)) endif + +$(LIBDIR): + mkdir -p $@ + +$(INCLUDEDIR): + mkdir -p $@ + +$(INCLUDEDIR)/adt: + mkdir -p $@ + +# generated the directory where all the generated documentation is +$(AUTODOCDIR): + mkdir -p $@ + +# print some help +.PHONY: help +help: + @echo "possible targets are:" + @echo "[$(targets)]" + @echo "but not all of them should be used or make sense" + # include dependencies -include .depend