rules.mk

Mon, 28 Aug 2000 12:24:32 +0200

author
tuomov
date
Mon, 28 Aug 2000 12:24:32 +0200
changeset 21
6d4282804e73
parent 17
a034888a2227
child 29
a2715cff4288
permissions
-rw-r--r--

trunk: changeset 24
Added tokz_warn

##
## Some make rules
##

######################################

ifdef SUBDIRS

all: subdirs $(TARGETS)

clean: subdirs-clean _clean

realclean: subdirs-realclean _realclean

depend: subdirs-depend _depend

else

all: $(TARGETS)

clean: _clean

realclean: _realclean

depend: _depend

endif

ifdef INSTALL_SUBDIRS

install: subdirs-install _install

else

install: _install

endif

######################################

.c.o:
	$(CC) $(CFLAGS) -c $< -o $@

_clean: 
	rm -f core $(OBJS) $(DEPEND_FILE) $(TO_CLEAN)

_realclean: _clean
	rm -f $(TARGETS) $(TO_REALCLEAN)

_depend:
	$(MAKE_DEPEND) *.c

######################################

subdirs:
	set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i; done

subdirs-depend:
	set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i depend; done

subdirs-clean:
	set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done

subdirs-realclean:
	set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i realclean; done

subdirs-install:
	set -e; for i in $(INSTALL_SUBDIRS); do $(MAKE) -C $$i install; done

######################################

ifeq ($(DEPEND_FILE),$(wildcard $(DEPEND_FILE)))
include $(DEPEND_FILE)
endif

mercurial