makefile doesn't rebuild everything on one script change

This commit is contained in:
John Alanbrook 2024-03-29 12:38:14 -05:00
parent 59ad64bbba
commit 1195e6c73d
3 changed files with 12 additions and 15 deletions

View file

@ -1,4 +1,4 @@
MAKEFLAGS = --jobs=4 MAKEFLAGS = --jobs=8
UNAME != uname UNAME != uname
MAKEDIR != pwd MAKEDIR != pwd
# Options # Options
@ -184,6 +184,8 @@ all: $(NAME)
SHADERS = $(shell ls source/shaders/*.sglsl) SHADERS = $(shell ls source/shaders/*.sglsl)
SHADERS := $(patsubst %.sglsl, %.sglsl.h, $(SHADERS)) SHADERS := $(patsubst %.sglsl, %.sglsl.h, $(SHADERS))
prereqs: $(SHADERS) source/engine/core.cdb.h
DESTDIR ?= ~/.bin DESTDIR ?= ~/.bin
install: $(NAME) install: $(NAME)
@echo Copying to destination @echo Copying to destination
@ -191,20 +193,20 @@ install: $(NAME)
$(NAME): $(OBJS) $(DEPS) $(NAME): $(OBJS) $(DEPS)
@echo Linking $(NAME) @echo Linking $(NAME)
$(CROSSWIN)$(LD) $^ $(CPPFLAGS) $(LDFLAGS) -L. $(LDPATHS) $(LDLIBS) -o $@ $(LD) $^ $(CPPFLAGS) $(LDFLAGS) -L. $(LDPATHS) $(LDLIBS) -o $@
@echo Finished build @echo Finished build
%$(INFO).o: %.c source/engine/core.cdb.h $(SHADERS) %$(INFO).o: %.c
@echo Making C object $@ @echo Making C object $@
$(CROSSWIN)$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
%$(INFO).o: %.cpp %$(INFO).o: %.cpp
@echo Making C++ object $@ @echo Making C++ object $@
$(CROSSWIN)$(CXX) $(CPPFLAGS) $(CXXFLAGS) -fpermissive -c $< -o $@ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -fpermissive -c $< -o $@
%$(INFO).o: %.m %$(INFO).o: %.m
@echo Making Objective-C object $@ @echo Making Objective-C object $@
$(CROSSWIN)$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
shaders: $(SHADERS) shaders: $(SHADERS)
@echo Making shaders @echo Making shaders
@ -238,10 +240,7 @@ icon.ico: $(ICON)
rm $(ICNNAME) rm $(ICNNAME)
resource.o: resource.rc resource.manifest icon.ico resource.o: resource.rc resource.manifest icon.ico
$(CROSSWIN)windres -i $< -o $@ windres -i $< -o $@
crosswin: packer resource.o
make CROSSWIN=x86_64-w64-mingw32- CC=$(CROSSWIN)gcc OS=Windows_NT ARCH=x86_64 DEBUG=$(DEBUG) OPT=$(OPT)
crossios: crossios:
make OS=IOS ARCH=arm64 DEBUG=$(DEBUG) OPT=$(OPT) make OS=IOS ARCH=arm64 DEBUG=$(DEBUG) OPT=$(OPT)

View file

@ -245,7 +245,6 @@ var SpriteAnim = {
return undefined; return undefined;
animcache[path] = anim; animcache[path] = anim;
console.spam(`Created animation like this:\n${json.encode(animcache[path])}`);
return animcache[path]; return animcache[path];
}, },
gif(path) { gif(path) {

View file

@ -217,7 +217,6 @@ var gameobject = {
}, },
cry(file) { cry(file) {
return;
this.crying = audio.play(file, audio.bus.sfx); this.crying = audio.play(file, audio.bus.sfx);
var killfn = () => { this.crying = undefined; var killfn = () => { this.crying = undefined;
console.warn("killed"); } console.warn("killed"); }