Clean up "make clean" targets

Remove "Makefile" targets, as they don't do what Eric wanted
pull/898/head
Jesse Vincent 4 years ago
parent ccc8542329
commit f00ba327d9
No known key found for this signature in database
GPG Key ID: CC228463465E40BC

@ -1,26 +1,34 @@
COMMON_LIB_DIR?=${PWD}/lib
TEST_DIRS=$(shell dirname $(wildcard */Makefile))
Makefile: ${TEST_DIRS} FORCE
DIRS=googletest hello-simulator kaleidoscope common
CLEANDIRS = $(DIRS:%=clean-%)
.PHONY: subdirs $(CLEANDIRS)
.PHONY: subdirs $(DIRS)
clean: googletest/Makefile $(CLEANDIRS)
rm -rf "$(COMMON_LIB_DIR)"
$(CLEANDIRS):
cd $(@:clean-%=%) && $(MAKE) clean
all: ${TEST_DIRS}
@echo TEST_DIRS="${TEST_DIRS}"
googletest: FORCE
googletest: googletest/Makefile
cd googletest && $(MAKE)
common: FORCE
cd common && env COMMON_LIB_DIR="${COMMON_LIB_DIR}" $(MAKE)
googletest/Makefile:
cd googletest && cmake .
clean:
rm -rf "${COMMON_LIB_DIR}"
cd googletest && make clean
cd common && make clean
cd hello-simulator && make clean
cd kaleidoscope && make clean
common:
cd common && COMMON_LIB_DIR="${COMMON_LIB_DIR}" $(MAKE)
hello-simulator:
@:
%: common googletest FORCE
%: common googletest
cd "$@" && $(MAKE)
.PHONY: FORCE googletest build-libs
.PHONY: googletest build-libs common

@ -4,10 +4,12 @@ Current behavior
- `make` builds googletest, common, kaleidoscope, and issue_840
- This is intended :)
- It is also intended that hello-simulator be omitted, since it has a test which is intended to fail to smoke test the framework
- `make clean` builds googletest, common, kaleidoscope, and issue_840, then manually runs make clean for each
FIXED - `make clean` builds googletest, common, kaleidoscope, and issue_840, then manually runs make clean for each
- Err... not intended
- Ideally `make clean` would recursively invoke `make clean` or equivalent
- `make issue_840` (or another target in $(TEST_DIRS)) builds googletest, common, kaleidoscope, and issue_840
FIXED - Ideally `make clean` would recursively invoke `make clean` or equivalent
FIXED - `make issue_840` (or another target in $(TEST_DIRS)) builds googletest, common, kaleidoscope, and issue_840
- Not intended
- Should just build googletest, common, and the target director (issue_840 in this case)
Desired (currently missing) behavior

@ -5,7 +5,7 @@ CXX_FILES=$(wildcard *.cpp)
LIB_FILE=libcommon.a
OBJ_FILES=$(patsubst %.cpp,${OBJ_DIR}/%.o,$(CXX_FILES))
Makefile: ${OBJ_FILES} ${COMMON_LIB_DIR}/${LIB_FILE}
all: ${OBJ_FILES} ${COMMON_LIB_DIR}/${LIB_FILE}
@:
${COMMON_LIB_DIR}/${LIB_FILE}: ${OBJ_FILES}

Loading…
Cancel
Save