Compare commits
No commits in common. "316b8bceb6ea72a5058cd0bf3d8ab3b0519fec4b" and "8ab0f72f5670c3b3a724372b02644979e473d0bb" have entirely different histories.
316b8bceb6
...
8ab0f72f56
5 changed files with 391 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,5 +1,3 @@
|
|||
*.a
|
||||
obj/
|
||||
bin/
|
||||
build/
|
||||
Makefile
|
||||
|
|
58
Makefile
Normal file
58
Makefile
Normal file
|
@ -0,0 +1,58 @@
|
|||
# Alternative GNU Make workspace makefile autogenerated by Premake
|
||||
|
||||
ifndef config
|
||||
config=debug
|
||||
endif
|
||||
|
||||
ifndef verbose
|
||||
SILENT = @
|
||||
endif
|
||||
|
||||
ifeq ($(config),debug)
|
||||
gearlib_config = debug
|
||||
test_config = debug
|
||||
|
||||
else ifeq ($(config),release)
|
||||
gearlib_config = release
|
||||
test_config = release
|
||||
|
||||
else
|
||||
$(error "invalid configuration $(config)")
|
||||
endif
|
||||
|
||||
PROJECTS := gearlib test
|
||||
|
||||
.PHONY: all clean help $(PROJECTS)
|
||||
|
||||
all: $(PROJECTS)
|
||||
|
||||
gearlib:
|
||||
ifneq (,$(gearlib_config))
|
||||
@echo "==== Building gearlib ($(gearlib_config)) ===="
|
||||
@${MAKE} --no-print-directory -C . -f gearlib.make config=$(gearlib_config)
|
||||
endif
|
||||
|
||||
test: gearlib
|
||||
ifneq (,$(test_config))
|
||||
@echo "==== Building test ($(test_config)) ===="
|
||||
@${MAKE} --no-print-directory -C . -f test.make config=$(test_config)
|
||||
endif
|
||||
|
||||
clean:
|
||||
@${MAKE} --no-print-directory -C . -f gearlib.make clean
|
||||
@${MAKE} --no-print-directory -C . -f test.make clean
|
||||
|
||||
help:
|
||||
@echo "Usage: make [config=name] [target]"
|
||||
@echo ""
|
||||
@echo "CONFIGURATIONS:"
|
||||
@echo " debug"
|
||||
@echo " release"
|
||||
@echo ""
|
||||
@echo "TARGETS:"
|
||||
@echo " all (default)"
|
||||
@echo " clean"
|
||||
@echo " gearlib"
|
||||
@echo " test"
|
||||
@echo ""
|
||||
@echo "For more information, see https://github.com/premake/premake-core/wiki"
|
193
gearlib.make
Normal file
193
gearlib.make
Normal file
|
@ -0,0 +1,193 @@
|
|||
# Alternative GNU Make project makefile autogenerated by Premake
|
||||
|
||||
ifndef config
|
||||
config=debug
|
||||
endif
|
||||
|
||||
ifndef verbose
|
||||
SILENT = @
|
||||
endif
|
||||
|
||||
.PHONY: clean prebuild
|
||||
|
||||
SHELLTYPE := posix
|
||||
ifeq (.exe,$(findstring .exe,$(ComSpec)))
|
||||
SHELLTYPE := msdos
|
||||
endif
|
||||
|
||||
# Configurations
|
||||
# #############################################
|
||||
|
||||
RESCOMP = windres
|
||||
INCLUDES += -Iinclude -Iinclude/gearlib
|
||||
FORCE_INCLUDE +=
|
||||
ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES)
|
||||
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
|
||||
LIBS += -lglfw -lm
|
||||
LDDEPS +=
|
||||
LINKCMD = $(AR) -rcs "$@" $(OBJECTS)
|
||||
define PREBUILDCMDS
|
||||
endef
|
||||
define PRELINKCMDS
|
||||
endef
|
||||
define POSTBUILDCMDS
|
||||
endef
|
||||
|
||||
ifeq ($(config),debug)
|
||||
TARGETDIR = bin/Debug/gearlib
|
||||
TARGET = $(TARGETDIR)/libgearlib.a
|
||||
OBJDIR = obj/Debug/gearlib
|
||||
DEFINES += -DDEBUG
|
||||
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g
|
||||
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
|
||||
ALL_LDFLAGS += $(LDFLAGS)
|
||||
|
||||
else ifeq ($(config),release)
|
||||
TARGETDIR = bin/Release/gearlib
|
||||
TARGET = $(TARGETDIR)/libgearlib.a
|
||||
OBJDIR = obj/Release/gearlib
|
||||
DEFINES += -DNDEBUG
|
||||
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O2
|
||||
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O2
|
||||
ALL_LDFLAGS += $(LDFLAGS) -s
|
||||
|
||||
endif
|
||||
|
||||
# Per File Configurations
|
||||
# #############################################
|
||||
|
||||
|
||||
# File sets
|
||||
# #############################################
|
||||
|
||||
GENERATED :=
|
||||
OBJECTS :=
|
||||
|
||||
GENERATED += $(OBJDIR)/batch.o
|
||||
GENERATED += $(OBJDIR)/camera.o
|
||||
GENERATED += $(OBJDIR)/debugging.o
|
||||
GENERATED += $(OBJDIR)/events.o
|
||||
GENERATED += $(OBJDIR)/gl.o
|
||||
GENERATED += $(OBJDIR)/implementations.o
|
||||
GENERATED += $(OBJDIR)/init.o
|
||||
GENERATED += $(OBJDIR)/quad.o
|
||||
GENERATED += $(OBJDIR)/renderer.o
|
||||
GENERATED += $(OBJDIR)/shaders.o
|
||||
GENERATED += $(OBJDIR)/textures.o
|
||||
GENERATED += $(OBJDIR)/uniform_buffer.o
|
||||
OBJECTS += $(OBJDIR)/batch.o
|
||||
OBJECTS += $(OBJDIR)/camera.o
|
||||
OBJECTS += $(OBJDIR)/debugging.o
|
||||
OBJECTS += $(OBJDIR)/events.o
|
||||
OBJECTS += $(OBJDIR)/gl.o
|
||||
OBJECTS += $(OBJDIR)/implementations.o
|
||||
OBJECTS += $(OBJDIR)/init.o
|
||||
OBJECTS += $(OBJDIR)/quad.o
|
||||
OBJECTS += $(OBJDIR)/renderer.o
|
||||
OBJECTS += $(OBJDIR)/shaders.o
|
||||
OBJECTS += $(OBJDIR)/textures.o
|
||||
OBJECTS += $(OBJDIR)/uniform_buffer.o
|
||||
|
||||
# Rules
|
||||
# #############################################
|
||||
|
||||
all: $(TARGET)
|
||||
@:
|
||||
|
||||
$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR)
|
||||
$(PRELINKCMDS)
|
||||
@echo Linking gearlib
|
||||
$(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 gearlib
|
||||
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)) del /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)/batch.o: src/batch.c
|
||||
@echo "$(notdir $<)"
|
||||
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
|
||||
$(OBJDIR)/camera.o: src/camera.c
|
||||
@echo "$(notdir $<)"
|
||||
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
|
||||
$(OBJDIR)/debugging.o: src/debugging.c
|
||||
@echo "$(notdir $<)"
|
||||
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
|
||||
$(OBJDIR)/events.o: src/events.c
|
||||
@echo "$(notdir $<)"
|
||||
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
|
||||
$(OBJDIR)/gl.o: src/gl.c
|
||||
@echo "$(notdir $<)"
|
||||
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
|
||||
$(OBJDIR)/implementations.o: src/implementations.c
|
||||
@echo "$(notdir $<)"
|
||||
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
|
||||
$(OBJDIR)/init.o: src/init.c
|
||||
@echo "$(notdir $<)"
|
||||
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
|
||||
$(OBJDIR)/quad.o: src/quad.c
|
||||
@echo "$(notdir $<)"
|
||||
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
|
||||
$(OBJDIR)/renderer.o: src/renderer.c
|
||||
@echo "$(notdir $<)"
|
||||
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
|
||||
$(OBJDIR)/shaders.o: src/shaders.c
|
||||
@echo "$(notdir $<)"
|
||||
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
|
||||
$(OBJDIR)/textures.o: src/textures.c
|
||||
@echo "$(notdir $<)"
|
||||
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
|
||||
$(OBJDIR)/uniform_buffer.o: src/uniform_buffer.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
|
|
@ -1,6 +1,5 @@
|
|||
workspace "gearlib"
|
||||
configurations { "Debug", "Release" }
|
||||
location "build"
|
||||
|
||||
project "gearlib"
|
||||
kind "StaticLib"
|
||||
|
|
140
test.make
Normal file
140
test.make
Normal file
|
@ -0,0 +1,140 @@
|
|||
# Alternative GNU Make project makefile autogenerated by Premake
|
||||
|
||||
ifndef config
|
||||
config=debug
|
||||
endif
|
||||
|
||||
ifndef verbose
|
||||
SILENT = @
|
||||
endif
|
||||
|
||||
.PHONY: clean prebuild
|
||||
|
||||
SHELLTYPE := posix
|
||||
ifeq (.exe,$(findstring .exe,$(ComSpec)))
|
||||
SHELLTYPE := msdos
|
||||
endif
|
||||
|
||||
# Configurations
|
||||
# #############################################
|
||||
|
||||
RESCOMP = windres
|
||||
INCLUDES += -Iinclude -Iinclude/gearlib
|
||||
FORCE_INCLUDE +=
|
||||
ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES)
|
||||
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
|
||||
LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
|
||||
define PREBUILDCMDS
|
||||
endef
|
||||
define PRELINKCMDS
|
||||
endef
|
||||
define POSTBUILDCMDS
|
||||
endef
|
||||
|
||||
ifeq ($(config),debug)
|
||||
TARGETDIR = bin/Debug/test
|
||||
TARGET = $(TARGETDIR)/test
|
||||
OBJDIR = obj/Debug/test
|
||||
DEFINES += -DDEBUG
|
||||
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g
|
||||
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
|
||||
LIBS += bin/Debug/gearlib/libgearlib.a -lglfw -lm
|
||||
LDDEPS += bin/Debug/gearlib/libgearlib.a
|
||||
ALL_LDFLAGS += $(LDFLAGS)
|
||||
|
||||
else ifeq ($(config),release)
|
||||
TARGETDIR = bin/Release/test
|
||||
TARGET = $(TARGETDIR)/test
|
||||
OBJDIR = obj/Release/test
|
||||
DEFINES += -DNDEBUG
|
||||
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O2
|
||||
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O2
|
||||
LIBS += bin/Release/gearlib/libgearlib.a -lglfw -lm
|
||||
LDDEPS += bin/Release/gearlib/libgearlib.a
|
||||
ALL_LDFLAGS += $(LDFLAGS) -s
|
||||
|
||||
endif
|
||||
|
||||
# Per File Configurations
|
||||
# #############################################
|
||||
|
||||
|
||||
# File sets
|
||||
# #############################################
|
||||
|
||||
GENERATED :=
|
||||
OBJECTS :=
|
||||
|
||||
GENERATED += $(OBJDIR)/test.o
|
||||
OBJECTS += $(OBJDIR)/test.o
|
||||
|
||||
# Rules
|
||||
# #############################################
|
||||
|
||||
all: $(TARGET)
|
||||
@:
|
||||
|
||||
$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR)
|
||||
$(PRELINKCMDS)
|
||||
@echo Linking test
|
||||
$(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 test
|
||||
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)) del /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)/test.o: examples/test.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
|
Loading…
Reference in a new issue