diff options
Diffstat (limited to 'Pong.make')
-rw-r--r-- | Pong.make | 155 |
1 files changed, 155 insertions, 0 deletions
diff --git a/Pong.make b/Pong.make new file mode 100644 index 0000000..d5501b5 --- /dev/null +++ b/Pong.make @@ -0,0 +1,155 @@ +# Alternative GNU Make project makefile autogenerated by Premake + +ifndef config + config=release +endif + +ifndef verbose + SILENT = @ +endif + +.PHONY: clean prebuild + +SHELLTYPE := posix +ifeq (.exe,$(findstring .exe,$(ComSpec))) + SHELLTYPE := msdos +endif + +# Configurations +# ############################################# + +RESCOMP = windres +TARGETDIR = bin/Release +TARGET = $(TARGETDIR)/Pong +OBJDIR = obj +DEFINES += +INCLUDES += +FORCE_INCLUDE += +ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -Og -g -ggdb `pkgconf --cflags raylib` `pkgconf --cflags glfw3` `pkgconf --cflags gl` `pkgconf --cflags sdl2` `pkgconf --cflags SDL2_mixer` `pkgconf --cflags glu` +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -Og -g -ggdb `pkgconf --cflags raylib` `pkgconf --cflags glfw3` `pkgconf --cflags gl` `pkgconf --cflags sdl2` `pkgconf --cflags SDL2_mixer` `pkgconf --cflags glu` +ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) +LIBS += +LDDEPS += +ALL_LDFLAGS += $(LDFLAGS) -s -g -ggdb `pkgconf --libs raylib` `pkgconf --libs glfw3` `pkgconf --libs gl` `pkgconf --libs sdl2` `pkgconf --libs SDL2_mixer` `pkgconf --libs glu` +LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) +define PREBUILDCMDS +endef +define PRELINKCMDS +endef +define POSTBUILDCMDS +endef + +# Per File Configurations +# ############################################# + + +# File sets +# ############################################# + +GENERATED := +OBJECTS := + +GENERATED += $(OBJDIR)/ball.o +GENERATED += $(OBJDIR)/enemy.o +GENERATED += $(OBJDIR)/main.o +GENERATED += $(OBJDIR)/marathon.o +GENERATED += $(OBJDIR)/pause.o +GENERATED += $(OBJDIR)/title.o +GENERATED += $(OBJDIR)/versus.o +OBJECTS += $(OBJDIR)/ball.o +OBJECTS += $(OBJDIR)/enemy.o +OBJECTS += $(OBJDIR)/main.o +OBJECTS += $(OBJDIR)/marathon.o +OBJECTS += $(OBJDIR)/pause.o +OBJECTS += $(OBJDIR)/title.o +OBJECTS += $(OBJDIR)/versus.o + +# Rules +# ############################################# + +all: $(TARGET) + @: + +$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) + $(PRELINKCMDS) + @echo Linking Pong + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) + +$(TARGETDIR): + @echo Creating $(TARGETDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(TARGETDIR) +else + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) +endif + +$(OBJDIR): + @echo Creating $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(OBJDIR) +else + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) +endif + +clean: + @echo Cleaning Pong +ifeq (posix,$(SHELLTYPE)) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) +else + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) rmdir /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) +endif + +prebuild: | $(OBJDIR) + $(PREBUILDCMDS) + +ifneq (,$(PCH)) +$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) +$(GCH): $(PCH) | prebuild + @echo $(notdir $<) + $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" +$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) touch "$@" +else + $(SILENT) echo $null >> "$@" +endif +else +$(OBJECTS): | prebuild +endif + + +# File Rules +# ############################################# + +$(OBJDIR)/ball.o: src/ball.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/enemy.o: src/enemy.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/main.o: src/main.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/marathon.o: src/marathon.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/pause.o: src/pause.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/title.o: src/title.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/versus.o: src/versus.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + +-include $(OBJECTS:%.o=%.d) +ifneq (,$(PCH)) + -include $(PCH_PLACEHOLDER).d +endif \ No newline at end of file |