Skip to content

Commit 2d0203d

Browse files
makenowjustAry Borenszweig
authored and
Ary Borenszweig
committed
Remove internal phony target
GNU Makefile's manual says: > A phony target should not be a prerequisite of a real target file
1 parent 4c50661 commit 2d0203d

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

Makefile

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ LLVM_EXT_OBJ = $(LLVM_EXT_DIR)/llvm_ext.o
4141
LIB_CRYSTAL_SOURCES = $(shell find src/ext -name '*.c')
4242
LIB_CRYSTAL_OBJS = $(subst .c,.o,$(LIB_CRYSTAL_SOURCES))
4343
LIB_CRYSTAL_TARGET = src/ext/libcrystal.a
44+
DEPS = $(LLVM_EXT_OBJ) $(LIB_CRYSTAL_TARGET)
4445
CFLAGS += -fPIC $(if $(debug),-g -O0)
4546
CXXFLAGS += $(if $(debug),-g -O0)
4647

@@ -71,15 +72,15 @@ help: ## Show this help
7172
awk 'BEGIN {FS = "## "}; /^## [a-zA-Z_-]/ {printf " \033[36m%s\033[0m\n", $$2}; /^## / {printf " %s\n", $$2}'
7273

7374
.PHONY: spec
74-
spec: all_spec ## Run all specs
75+
spec: $(O)/all_spec ## Run all specs
7576
$(O)/all_spec $(VERBOSE)
7677

7778
.PHONY: std_spec
78-
std_spec: all_std_spec ## Run standard library specs
79+
std_spec: $(O)/std_spec ## Run standard library specs
7980
$(O)/std_spec $(VERBOSE)
8081

8182
.PHONY: compiler_spec
82-
compiler_spec: all_compiler_spec ## Run compiler specs
83+
compiler_spec: $(O)/compiler_spec ## Run compiler specs
8384
$(O)/compiler_spec $(VERBOSE)
8485

8586
.PHONY: doc
@@ -89,29 +90,19 @@ doc: ## Generate standard library documentation
8990
.PHONY: crystal
9091
crystal: $(O)/crystal ## Build the compiler
9192

92-
.PHONY: all_spec all_std_spec all_compiler_spec
93-
all_spec: $(O)/all_spec
94-
all_std_spec: $(O)/std_spec
95-
all_compiler_spec: $(O)/compiler_spec
96-
97-
.PHONY: llvm_ext libcrystal deps
98-
llvm_ext: $(LLVM_EXT_OBJ)
99-
libcrystal: $(LIB_CRYSTAL_TARGET)
100-
deps: llvm_ext libcrystal
101-
102-
$(O)/all_spec: deps $(SOURCES) $(SPEC_SOURCES)
93+
$(O)/all_spec: $(DEPS) $(SOURCES) $(SPEC_SOURCES)
10394
@mkdir -p $(O)
10495
$(BUILD_PATH) ./bin/crystal build $(FLAGS) -o $@ spec/all_spec.cr
10596

106-
$(O)/std_spec: deps $(SOURCES) $(SPEC_SOURCES)
97+
$(O)/std_spec: $(DEPS) $(SOURCES) $(SPEC_SOURCES)
10798
@mkdir -p $(O)
10899
$(BUILD_PATH) ./bin/crystal build $(FLAGS) -o $@ spec/std_spec.cr
109100

110-
$(O)/compiler_spec: deps $(SOURCES) $(SPEC_SOURCES)
101+
$(O)/compiler_spec: $(DEPS) $(SOURCES) $(SPEC_SOURCES)
111102
@mkdir -p $(O)
112103
$(BUILD_PATH) ./bin/crystal build $(FLAGS) -o $@ spec/compiler_spec.cr
113104

114-
$(O)/crystal: deps $(SOURCES)
105+
$(O)/crystal: $(DEPS) $(SOURCES)
115106
@mkdir -p $(O)
116107
$(BUILD_PATH) $(EXPORTS) ./bin/crystal build $(FLAGS) -o $@ src/compiler/crystal.cr -D without_openssl -D without_zlib
117108

0 commit comments

Comments
 (0)