From 4286a0ba7c5c1e5bc5856b77ed650a144dff72cc Mon Sep 17 00:00:00 2001 From: Shariq Shah Date: Tue, 10 May 2016 16:06:00 +0500 Subject: [PATCH] Moved from premake4 to simple makefiles --- build/linux/makefile | 21 +++++++++++++++++++++ premake4.lua | 32 -------------------------------- 2 files changed, 21 insertions(+), 32 deletions(-) create mode 100644 build/linux/makefile delete mode 100644 premake4.lua diff --git a/build/linux/makefile b/build/linux/makefile new file mode 100644 index 0000000..82e288c --- /dev/null +++ b/build/linux/makefile @@ -0,0 +1,21 @@ +PROJECT_NAME=Symmetry +CC=gcc +SRC_DIR=../../src +SRCS=$(patsubst $(SRC_DIR)/%.c, %.c, $(wildcard ../../src/*.c)) +OBJS=$(patsubst %.c,%.o,$(SRCS)) +CFLAGS= -g -Wall +LIBS=$(shell pkg-config --static --libs glfw3 glew) + +all: $(OBJS) + echo $(SRCS) + echo $(OBJS) + $(CC) $(CFLAGS) -o $(PROJECT_NAME) $^ $(LIBS) + +%.o: $(SRC_DIR)/%.c + $(CC) -c $< -o $@ + +clean: + @echo $(SRCS) + @echo $(OBJS) + rm $(PROJECT_NAME) + rm $(OBJS) diff --git a/premake4.lua b/premake4.lua deleted file mode 100644 index a5b6d3d..0000000 --- a/premake4.lua +++ /dev/null @@ -1,32 +0,0 @@ -solution "Symmetry" -configurations {"Debug", "Release"} -location "build" -language "C" -includedirs {"include/**"} -buildoptions {"-Wall", "-std=c11"} -linkoptions { "`pkg-config --libs --static glfw3`" } -links {"GLEW"} -local lib_base = "libs" - --- local cmd_stream = assert(io.popen("pkg-config --libs --static glfw3", r)) --- local libs_to_link = assert(cmd_stream:read("*all")) --- cmd_stream:close() --- libs_to_link = string.gsub(libs_to_link, "-lglfw", "") --- libs_to_link = string.gsub(libs_to_link, "\n", "") --- linkoptions {libs_to_link} - -project "Symmetry" -kind "ConsoleApp" -files { "src/*.h", "src/*.c"} - -configuration "Debug" -flags {"Symbols"} -libdirs {path.join(lib_base, "debug/**")} -targetdir "bin/debug" - -configuration "Release" -defines {"NDEBUG"} -flags {"Optimize"} -libdirs {path.join(lib_base, "release/**")} -targetdir "bin/release" -