makefile 样本
TOP_BUILDDIR=$(shell pwd)
SUBDIRS=libddbg libparam diskmodel memsmodel ssdmodel src
all:
$(MAKE) -C libddbg # $(MAKE)==make,
$(MAKE) -C libparam #Change to directory dir before reading the makefiles or doing anything else.
$(MAKE) -C diskmodel
$(MAKE) -C memsmodel
$(MAKE) -C ssdmodel
$(MAKE) -C src
$(MAKE) -C diskmodel/layout_g4_tools
# If dixtrac is included, build it with the distribution
if [ -d dixtrac ]; then $(MAKE) -C dixtrac ; fi
clean:
for d in $(SUBDIRS); do \
$(MAKE) -C $$d $@; \ # make -C $d clean;
done
distclean: clean
rm -f *~
for d in $(SUBDIRS); do \
$(MAKE) -C $$d $@; \
done
.PHONY: doc
doc:
$(MAKE) -C libddbg
$(MAKE) -C libparam
$(MAKE) -C src/modules
$(MAKE) -C diskmodel/modules
$(MAKE) -C memsmodel/modules
$(MAKE) -C ssdmodel/modules
doc-clean:
$(MAKE) -C memsmodel/modules distclean
$(MAKE) -C diskmodel/modules distclean
$(MAKE) -C ssdmodel/modules distclean
$(MAKE) -C src/modules distclean
$(MAKE) -C libparam distclean
$(MAKE) -C libddbg distclean