Fixed *.d handling, fixed sdl2 flags

This commit is contained in:
Bob Polis 2023-02-13 11:31:54 +01:00
parent 3dad4173e7
commit de1f188a6d

View File

@ -39,7 +39,11 @@ else
CXXFLAGS += -D NDEBUG -O3
endif
LDLIBS := -lm -lscgui -lSDL2 -lcairo -lscerror -lscstring -lscscreensaver -lscnumerics
LDLIBS := -lm -lscgui -lcairo -lscerror -lscstring -lscscreensaver -lscnumerics
LDLIBS += $(shell pkg-config sdl2 --libs)
CXXFLAGS += $(shell pkg-config sdl2 --cflags)
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
@ -53,15 +57,13 @@ endif
all: $(BIN) modules
$(BIN): $(OBJS) $(DEPS)
$(BIN): $(OBJS)
$(CXX) $(OBJS) $(LDFLAGS) $(LDLIBS) -o $(BIN)
%.o: %.cpp %.d Makefile
%.o %.d: %.cpp
$(CXX) $(CXXFLAGS) -MMD -MP -MT $@ -MF $*.d -c $<
-include *.d
%.d: ;
-include $(DEPS)
new:
@./newmodule $(NEW_ARGS)