Compare commits
4 Commits
e95a6ae246
...
ac18ecb86d
Author | SHA1 | Date |
---|---|---|
nekobit | ac18ecb86d | |
nekobit | ec186e9a18 | |
nekobit | 04626f9e3f | |
nekobit | aa44b9cc3f |
|
@ -5,5 +5,5 @@ docs/html/
|
|||
docs/latex/
|
||||
build/
|
||||
obj/
|
||||
Mastodont.make
|
||||
mastodont.make
|
||||
Makefile
|
||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,4 +1,4 @@
|
|||
Copyright (c) 2022, Nekobit
|
||||
Copyright (c) 2023, Nekobit
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
prefix=/usr/local
|
||||
exec_prefix=${prefix}
|
||||
includedir=${prefix}/include
|
||||
libdir=${exec_prefix}/lib
|
||||
|
||||
Name: mastodont
|
||||
Description: The mastodont library
|
||||
Version: 0.0.1
|
||||
Requires: libcjson libcurl
|
||||
Cflags: -I${includedir}/mastodont
|
||||
Libs: -L${libdir} -lmastodont
|
|
@ -0,0 +1,38 @@
|
|||
solution "mastodont-c"
|
||||
configurations { "Debug", "Release" };
|
||||
|
||||
-- BEGIN Mastodont project
|
||||
project("mastodont");
|
||||
kind("StaticLib");
|
||||
language("C");
|
||||
files { "include/*.h", "src/*.c" };
|
||||
includedirs { "include/" };
|
||||
|
||||
configuration { "linux", "bsd", "gmake" };
|
||||
linkoptions { "`curl-config --libs`" };
|
||||
linkoptions { "`pkg-config --libs cjson`" };
|
||||
|
||||
configuration { "Debug" };
|
||||
defines { "DEBUG" };
|
||||
flags("Symbols");
|
||||
|
||||
configuration { "Release" };
|
||||
defines { "NDEBUG" };
|
||||
flags("Optimize");
|
||||
-- END Mastodont-c
|
||||
|
||||
local prefix = os.getenv("PREFIX") or "/usr/local";
|
||||
local pkgconfig_path = os.getenv("PKG_CONFIG_PATH") or
|
||||
(os.isdir(prefix .. "/pkgconfig") and prefix .. "/pkgconfig") or
|
||||
prefix .. "/share/pkgconfig";
|
||||
|
||||
newaction {
|
||||
trigger = "install",
|
||||
description = "install the library",
|
||||
execute = function()
|
||||
os.copyfile("libmastodont.a", prefix .. "/lib");
|
||||
os.execute("install -d include/ " .. prefix .. "/include");
|
||||
os.mkdir(pkgconfig_path);
|
||||
os.copyfile("mastodont.pc", pkgconfig_path .. "/mastodont.pc");
|
||||
end
|
||||
}
|
22
premake5.lua
22
premake5.lua
|
@ -1,22 +0,0 @@
|
|||
workspace("Mastodont");
|
||||
configurations { "Debug", "Release" };
|
||||
|
||||
-- BEGIN Mastodont project
|
||||
project("Mastodont");
|
||||
kind("StaticLib");
|
||||
language("C");
|
||||
files { "include/*.h", "src/*.c" };
|
||||
includedirs { "include/" };
|
||||
|
||||
filter { "system:linux or bsd or macosx", "action:gmake" }
|
||||
linkoptions { "`curl-config --libs`" }
|
||||
linkoptions { "`pkg-config --libs cjson`" }
|
||||
|
||||
filter { "configurations:Debug" };
|
||||
defines { "DEBUG" };
|
||||
symbols("On");
|
||||
|
||||
filter { "configurations:Release" };
|
||||
defines { "NDEBUG" };
|
||||
optimize("On");
|
||||
-- END Mastodont-c
|
Loading…
Reference in New Issue