Compare commits

...

4 Commits

Author SHA1 Message Date
nekobit ac18ecb86d pkg-config Requires
FossilOrigin-Name: e0a3f0ff53267e57f0a9dccd2d78e8a1d3d0b67cf8a80b0e921ca405f85c4c2e
2023-03-23 14:23:54 +00:00
nekobit ec186e9a18 pkg-config file
FossilOrigin-Name: d3f51656b06b06361158288c26c31402948ed0b2fa7a37c0db598712c00f8150
2023-03-23 14:19:04 +00:00
nekobit 04626f9e3f Bump
FossilOrigin-Name: e54e3c6e99c1037b42a11c974f3c4a57c615aa6c99a16a4254fd0357f8db838e
2023-03-23 11:49:52 +00:00
nekobit aa44b9cc3f Switch to premake4 for compat
FossilOrigin-Name: 7f62c6520aa3a5e3e959cd68229459d6126c84153a9b131f2d406fa75e77baa7
2023-03-23 11:49:29 +00:00
5 changed files with 51 additions and 24 deletions

View File

@ -5,5 +5,5 @@ docs/html/
docs/latex/
build/
obj/
Mastodont.make
mastodont.make
Makefile

View File

@ -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:

11
mastodont.pc Normal file
View File

@ -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

38
premake4.lua Normal file
View File

@ -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
}

View File

@ -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