Skip to content

Commit

Permalink
Improve Make process for parallel Make.
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Donnelly committed Jun 21, 2014
1 parent 6f231da commit 250de7e
Show file tree
Hide file tree
Showing 30 changed files with 126 additions and 170 deletions.
20 changes: 20 additions & 0 deletions .src.Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
include ../Makefile.config
include ../Makefile.rules

PHONY_TARGETS ?= src
TARGETS ?= $(PHONY_TARGETS)

$(TARGETS):
@$(MAKE) -C $@

CLEAN_TARGETS = $(TARGETS:%=clean-%)
$(CLEAN_TARGETS):
@$(MAKE) -C $(@:clean-%=%) clean
clean: $(CLEAN_TARGETS)

INSTALL_TARGETS = $(TARGETS:%=install-%)
$(INSTALL_TARGETS): $(TARGETS)
@$(MAKE) -C $(@:install-%=%) install
install: $(INSTALL_TARGETS)

.PHONY: $(PHONY_TARGETS) all clean install test
38 changes: 29 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,38 @@
include Makefile.config
include Makefile.rules

all clean: Makefile.config
for p in ${CCTOOLS_PACKAGES} ; do cd $$p && ${MAKE} $@ && cd .. ; done
all: $(CCTOOLS_PACKAGES)

test: Makefile.config
./run_all_tests.sh
Makefile.config:
@echo "You must run 'configure' before '${MAKE}'."
@exit 1

chirp work_queue sand allpairs wavefront makeflow ftp_lite parrot resource_monitor resource_monitor_visualizer makeflow_linker: dttools

allpairs: sand work_queue
makeflow: chirp work_queue
parrot: chirp ftp_lite
sand: work_queue
wavefront: chirp work_queue
work_queue: chirp

$(CCTOOLS_PACKAGES): Makefile.config
@$(MAKE) -C $@

install: all Makefile.config
for p in ${CCTOOLS_PACKAGES} ; do cd $$p && ${MAKE} $@ && cd .. ; done
CLEAN_PACKAGES = $(CCTOOLS_PACKAGES:%=clean-%)
$(CLEAN_PACKAGES):
@$(MAKE) -C $(@:clean-%=%) clean
clean: $(CLEAN_PACKAGES)

INSTALL_PACKAGES = $(CCTOOLS_PACKAGES:%=install-%)
$(INSTALL_PACKAGES): $(CCTOOLS_PACKAGES)
@$(MAKE) -C $(@:install-%=%) install
install: $(INSTALL_PACKAGES)
mkdir -p ${CCTOOLS_INSTALL_DIR}/etc
cp Makefile.config ${CCTOOLS_INSTALL_DIR}/etc/Makefile.config
cp COPYING ${CCTOOLS_INSTALL_DIR}/doc

Makefile.config:
@echo "You must run 'configure' before '${MAKE}'."
@exit 1
test: $(CCTOOLS_PACKAGES)
./run_all_tests.sh

.PHONY: $(CCTOOLS_PACKAGES) $(INSTALL_PACKAGES) $(CLEAN_PACKAGES) all clean install test
7 changes: 0 additions & 7 deletions allpairs/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions allpairs/Makefile
10 changes: 2 additions & 8 deletions apps/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
include ../Makefile.config
include ../Makefile.rules
PHONY_TARGETS = wq_replica_exchange

all test clean:
@for p in wq_replica_exchange; do cd $$p && $(MAKE) $@ && cd .. ; done

install:

.PHONY: all test install clean
include ../.src.Makefile
7 changes: 0 additions & 7 deletions chirp/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions chirp/Makefile
18 changes: 0 additions & 18 deletions deltadb/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions deltadb/Makefile
6 changes: 6 additions & 0 deletions deltadb/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ HEADERS = ${SOURCES:%.c=%.h}
LIBRARIES = libdeltadb.a
PROGRAMS = deltadb_collect deltadb_select_static deltadb_select_dynamic deltadb_select_complete deltadb_project deltadb_reduce_temporal deltadb_reduce_spatial deltadb_pivot
PROGRAM_SOURCES = ${PROGRAMS:%=%.c}
SCRIPTS= deltadb_collect deltadb_select_static deltadb_select_dynamic deltadb_select_complete deltadb_project deltadb_reduce_temporal deltadb_reduce_spatial deltadb_pivot

all: ${LIBRARIES} $(PROGRAMS)

Expand Down Expand Up @@ -48,6 +49,11 @@ test: all
clean:
rm -f core *~ *.o *.os *.so $(LIBRARIES) $(PROGRAMS)

uninstall:
for s in ${SCRIPTS}; do rm -f ${CCTOOLS_INSTALL_DIR}/bin/$$s; done

install: all
mkdir -p ${CCTOOLS_INSTALL_DIR}/bin
for s in ${SCRIPTS}; do cat $$s | sed "s:CCTOOLS_VERSION:${CCTOOLS_VERSION}:g" | sed "s:CCTOOLS_RELEASEDATE:${CCTOOLS_RELEASEDATE}:g" > ${CCTOOLS_INSTALL_DIR}/bin/$$s; chmod 755 ${CCTOOLS_INSTALL_DIR}/bin/$$s; done

.PHONY: all clean install test uninstall
2 changes: 2 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ test:

clean:
rm -rf api $(HTMLFILES) $(MANFILES) $(ZIPFILES) *~

.PHONY: all clean install test
7 changes: 0 additions & 7 deletions dttools/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions dttools/Makefile
5 changes: 0 additions & 5 deletions ftp_lite/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions ftp_lite/Makefile
5 changes: 0 additions & 5 deletions ftsh/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions ftsh/Makefile
7 changes: 0 additions & 7 deletions makeflow/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions makeflow/Makefile
7 changes: 0 additions & 7 deletions makeflow_linker/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions makeflow_linker/Makefile
5 changes: 0 additions & 5 deletions parrot/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions parrot/Makefile
7 changes: 0 additions & 7 deletions resource_monitor/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions resource_monitor/Makefile
22 changes: 0 additions & 22 deletions resource_monitor_visualizer/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions resource_monitor_visualizer/Makefile
21 changes: 21 additions & 0 deletions resource_monitor_visualizer/src/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
include ../../Makefile.config
include ../../Makefile.rules

SCRIPT = resource_monitor_visualizer.py
STATIC_RESOURCES = resource_monitor_visualizer_static

all: $(SCRIPT)

clean:

install: all
mkdir -p ${CCTOOLS_INSTALL_DIR}/bin
mkdir -p ${CCTOOLS_INSTALL_DIR}/lib
cp ${SCRIPT} ${CCTOOLS_INSTALL_DIR}/bin/
cp -r ${STATIC_RESOURCES} ${CCTOOLS_INSTALL_DIR}/lib/

uninstall:
rm -rf ${CCTOOLS_INSTALL_DIR}/lib/$(STATIC_RESOURCES)
rm -f ${CCTOOLS_INSTALL_DIR}/${SCRIPT}

.PHONY: all clean install test
5 changes: 0 additions & 5 deletions s3tools/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions s3tools/Makefile
7 changes: 0 additions & 7 deletions sand/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions sand/Makefile
7 changes: 0 additions & 7 deletions wavefront/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions wavefront/Makefile
7 changes: 0 additions & 7 deletions work_queue/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions work_queue/Makefile
Loading

0 comments on commit 250de7e

Please sign in to comment.