2 posts
4Coder Build System

Hi everyone!

A few days ago I decided to have a look at the source code of 4ed and try to play around with it, so I pulled the repository and followed the instruction to build but it failed. At the moment I am trying to reverse engeneer the build system, but I was wondering if anyone else have had troubles with it.

Any tips very much wellcome :)

Simon Anciaux
1341 posts
4Coder Build System
Edited by Simon Anciaux on

There were two issues for me:

  • I misunderstood where the instructions said to place the 4coder-non-source directory. It needs to be in the 4ed folder, not next to it.

So the folders look like:

  • And there is a missing % in 4ed/code/bin/build.bat. Line 12 should be set custom_bin=%custom_root%\bin instead of set custom_bin=%custom_root\bin.

To debug batch script, don't forget to turn echo on by changing @echo off to @echo on at the top of the script to see what each line evaluates to.

And when asking questions about something not working, please post as much relevant information as possible, like what the error is or what the console prints out.

Jack Punter
1 posts
4Coder Build System

The 4coder build system is very complicated, a few of us did make a fork, but due to external factors we've not had the time to do too much with it, it does have some bug fixes and minor improvements though (higher refresh rate on windows for example). There is currently a PR open that AFAIK works, but I've only been able to test on windows pulling all the repos into a monorepo to make the build system a little easier to get setup. https://github.com/4coder-community/4cc/tree/Monorepo. So if its easier feel free to take that as your starting point, as the other comment mentions, the base repo doesn't make the setup particularly clear. If you do go with these please lmk if you run into any issues, it probably makes sense to merge this tbh.

2 posts
4Coder Build System

Hello everyone, sorry for the late replay, life some times get in the way.

First of all thank you for your replies.

@mrmixer you are absolutely right, I should have included much more details, I apologize. You are also right about the misplacement of the folders. I am pretty sure, even though I cannot check atm, that I have put the non-source folder one level above.

@TarriestPython I will definitely check out the repo asap, it looks very interesting.

I am not an expert when it comes to build systems. I have never moved past the few lines build.bat for my personal projects, so I would like to understand the reasons for such a complicated system and what are the benefits.

Simon Anciaux
1341 posts
4Coder Build System
Replying to Mevex (#29412)

I think that build system was just for Allen (the creator of 4coder) and not intended to be used by other persons.

It's a bit convoluted at first glance, but what it does is to compile a cpp file to an exe, and that exe creates and executes the commands needed to compile, just like a batch file. I think (not verified it) that once you have the build.exe file, you can just run that.

The reason for using a cpp file instead of a batch file is (I think) that it's a language we are more used to (used every day as opposed to every once in a while for batch) and with arguably better syntax to do more "complex" things. And it's the same language on each platforms 4coder shipped to.

2 posts
4Coder Build System

Hello :D

I know I'm very late, I've been working on simplifying the build system. The repo can be found at https://github.com/SL-code/4cc (the monorepo branch)

I also added:

  • a few more themes,
  • a new font
  • and two custom layers (byp and jack punter's layers).

I documented the new build system as best as I could, if something is unclear please let me know.

I will continue to update it a bit because it still not fully implemented. I will remove the "packaging" aspect of the system because it is not needed anymore. I need to implement a way of compiling all the language files and the documentation system.

I also found 4ed_build.cpp to be extra convoluted ':D I refactored it a bit in the hopes that it is easier to work on. If you are interested in the build system, I'm looking forward to hearing your opinion.

Have a great day :D