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

View file

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

View file

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