mirror of
https://github.com/Perlmint/glew-cmake.git
synced 2024-11-11 09:33:49 +00:00
Fix build race in Makefile
The current rule for the binaries is: glew.bin: glew.lib bin bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) In parallel builds, all of those targets happen at the same time. This means that 'bin' can happen *after* 'bin/$(GLEWINFO.BIN)', which is a problem as the 'bin' target's responsibility is to create the directory that the other target writes into. Solve this by not having a separate 'create directory' target which is fundamentally racy, and simply mkdir in each target which writes into it.
This commit is contained in:
parent
679a3b17fa
commit
767e031645
9
Makefile
9
Makefile
@ -171,21 +171,20 @@ VISUALINFO.BIN.OBJ := $(VISUALINFO.BIN.OBJ:.c=.o)
|
|||||||
# Don't build glewinfo or visualinfo for NaCL, yet.
|
# Don't build glewinfo or visualinfo for NaCL, yet.
|
||||||
|
|
||||||
ifneq ($(filter nacl%,$(SYSTEM)),)
|
ifneq ($(filter nacl%,$(SYSTEM)),)
|
||||||
glew.bin: glew.lib bin
|
glew.bin: glew.lib
|
||||||
else
|
else
|
||||||
glew.bin: glew.lib bin bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN)
|
glew.bin: glew.lib bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
bin:
|
|
||||||
mkdir bin
|
|
||||||
|
|
||||||
bin/$(GLEWINFO.BIN): $(GLEWINFO.BIN.OBJ) $(LIB.SHARED.DIR)/$(LIB.SHARED)
|
bin/$(GLEWINFO.BIN): $(GLEWINFO.BIN.OBJ) $(LIB.SHARED.DIR)/$(LIB.SHARED)
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
$(CC) $(CFLAGS) -o $@ $(GLEWINFO.BIN.OBJ) $(BIN.LIBS)
|
$(CC) $(CFLAGS) -o $@ $(GLEWINFO.BIN.OBJ) $(BIN.LIBS)
|
||||||
ifneq ($(STRIP),)
|
ifneq ($(STRIP),)
|
||||||
$(STRIP) -x $@
|
$(STRIP) -x $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
bin/$(VISUALINFO.BIN): $(VISUALINFO.BIN.OBJ) $(LIB.SHARED.DIR)/$(LIB.SHARED)
|
bin/$(VISUALINFO.BIN): $(VISUALINFO.BIN.OBJ) $(LIB.SHARED.DIR)/$(LIB.SHARED)
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
$(CC) $(CFLAGS) -o $@ $(VISUALINFO.BIN.OBJ) $(BIN.LIBS)
|
$(CC) $(CFLAGS) -o $@ $(VISUALINFO.BIN.OBJ) $(BIN.LIBS)
|
||||||
ifneq ($(STRIP),)
|
ifneq ($(STRIP),)
|
||||||
$(STRIP) -x $@
|
$(STRIP) -x $@
|
||||||
|
Loading…
Reference in New Issue
Block a user