Compare commits

...

3 Commits

Author SHA1 Message Date
nekobit 0b1b8f60a4 Cleanup
FossilOrigin-Name: 66200db6f53cf736216777c7922d658ef47c00b93d2aa5844babf81d98a91359
2023-03-27 04:03:59 +00:00
nekobit 9518274848 Merge files
FossilOrigin-Name: 6ec1414ee879b0cfacb461460908e5b0f7495551a031e0da1111d841139389a8
2023-03-27 04:01:36 +00:00
nekobit 78c09fd7dc Finish premake transition
FossilOrigin-Name: 30676561791954ccd8a2d8cb627fdb74b0cd38780ffa3b17a9aae4719a26e3fe
2023-03-27 03:36:57 +00:00
5 changed files with 29 additions and 47 deletions

View File

@ -1,3 +1,4 @@
Makefile
template
ctemplate
filec
@ -15,3 +16,4 @@ templates/*.ctt
test/unit/*.bin
compile_commands.json
build/
obj/

View File

@ -1,34 +0,0 @@
# GNU Make solution makefile autogenerated by Premake
# Type "make help" for usage help
ifndef config
config=debug
endif
export config
PROJECTS := treebird
.PHONY: all clean help $(PROJECTS)
all: $(PROJECTS)
treebird:
@echo "==== Building treebird ($(config)) ===="
@${MAKE} --no-print-directory -C . -f treebird.make
clean:
@${MAKE} --no-print-directory -C . -f treebird.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 " treebird"
@echo ""
@echo "For more information, see http://industriousone.com/premake/quick-start"

View File

@ -26,7 +26,7 @@ local c_files = {
'request.c',
'session.c',
'path.c',
'mime.c'
'mime.c',
};
-- Not actually real 'pages', but the ones we compile in / create definitions
@ -71,15 +71,29 @@ for i=1, table.getn(pages) do pages[i] = 'src/'.. pages[i] end
project("treebird");
kind("ConsoleApp");
language("C");
--files { table.unpack(c_files), table.unpack(pages) };
-- Merge pages into c_files
for _, v in ipairs(pages) do
table.insert(c_files, v);
end
files(c_files);
files(pages);
includedirs { "include/" };
defines(definitions);
configuration { "linux", "bsd", "gmake" };
linkoptions { "`pkg-config --libs mastodont`" };
-- TODO figure out perl...
-- For some reason this one doesn't have a pkg-config file
local libfcgi = os.findlib("libfcgi");
if not libfcgi then
print("Couldn't find libfcgi (aka fcgi-devkit). Probably gonna need that.\n");
os.exit(1);
end
configuration { "gmake" };
linkoptions{ "`pkg-config --libs mastodont` `perl -MExtUtils::Embed -e ldopts`" };
buildoptions{ "`pkg-config --cflags mastodont` `perl -MExtUtils::Embed -e ccopts`" };
links{"fcgi"};
if premake.gcc.cc ~= 'clang' then
buildoptions{"-Wno-compound-token-split-by-macro"};
end
configuration { "Debug" };
defines { "DEBUG" };

View File

@ -7,7 +7,7 @@
#ifndef GLOBAL_PERL_H
#define GLOBAL_PERL_H
// Hack on my system... if this breaks anything, plz dig deeper
/* Libperl has lots of warnings... */
#include <EXTERN.h>
#include <perl.h>
#include "memory.h"

View File

@ -26,12 +26,12 @@ ifeq ($(config),debug)
DEFINES += -DCMP_ENABLE_ABOUT -DCMP_ENABLE_ACCOUNT -DCMP_ENABLE_APPLICATIONS -DCMP_ENABLE_ATTACHMENTS -DCMP_ENABLE_BASE_PAGE -DCMP_ENABLE_CONVERSATIONS -DCMP_ENABLE_EMOJI -DCMP_ENABLE_EMOJI_REACTION -DCMP_ENABLE_GLOBAL_CACHE -DCMP_ENABLE_GLOBAL_PERL -DCMP_ENABLE_HASHTAG -DCMP_ENABLE_HTTP -DCMP_ENABLE_INDEX -DCMP_ENABLE_LISTS -DDEBUG
INCLUDES += -Iinclude
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES)
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -g
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -g `pkg-config --cflags mastodont` `perl -MExtUtils::Embed -e ccopts` -Wno-compound-token-split-by-macro
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
ALL_LDFLAGS += $(LDFLAGS)
ALL_LDFLAGS += $(LDFLAGS) -L. `pkg-config --libs mastodont` `perl -MExtUtils::Embed -e ldopts`
LDDEPS +=
LIBS += $(LDDEPS)
LIBS += $(LDDEPS) -lfcgi
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
define PREBUILDCMDS
endef
@ -48,12 +48,12 @@ ifeq ($(config),release)
DEFINES += -DCMP_ENABLE_ABOUT -DCMP_ENABLE_ACCOUNT -DCMP_ENABLE_APPLICATIONS -DCMP_ENABLE_ATTACHMENTS -DCMP_ENABLE_BASE_PAGE -DCMP_ENABLE_CONVERSATIONS -DCMP_ENABLE_EMOJI -DCMP_ENABLE_EMOJI_REACTION -DCMP_ENABLE_GLOBAL_CACHE -DCMP_ENABLE_GLOBAL_PERL -DCMP_ENABLE_HASHTAG -DCMP_ENABLE_HTTP -DCMP_ENABLE_INDEX -DCMP_ENABLE_LISTS -DNDEBUG
INCLUDES += -Iinclude
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES)
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -O2
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -O2 `pkg-config --cflags mastodont` `perl -MExtUtils::Embed -e ccopts` -Wno-compound-token-split-by-macro
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
ALL_LDFLAGS += $(LDFLAGS) -s
ALL_LDFLAGS += $(LDFLAGS) -L. -s `pkg-config --libs mastodont` `perl -MExtUtils::Embed -e ldopts`
LDDEPS +=
LIBS += $(LDDEPS)
LIBS += $(LDDEPS) -lfcgi
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
define PREBUILDCMDS
endef