Stef-Verniers

Stef-Verniers

Hello

I’ve been coding in Elixir for almost two years now because of my current job where we implemented Elixir in our application. But after two years, there is still so much to discover and knowledge I don’t have obtained yet.

I’m working on a private project now, using Elixir, but I find it kind of hard to learn this new step I want to implement in the private project: The setup of the Makefile

I looked at the Makefile of my job but this was such a huge difference with the examples I’ve came across on different sites. This makes it difficult to know what is necessary and what’s not.

The Makefile for my project should start the server, make sure the database is spinning, Docker containers are online and operating and that’s probably it for now.

How do I start? What’s important, what’s not?

Kind regards
Stef

Showing Posts 1 to 10

derek-zhou

derek-zhou

Makefiles are for old timers, like me. Yes, it is powerful; however, it comes with a lot of sharp edges and Makefile beyond certain size will be hopelessly unmaintainable.

Before opening a big can of worms, please ask yourself: “Do I really need a Makefile?”

colorfulcms

colorfulcms

For a first Makefile, I’d keep it as thin task aliases rather than real build logic. Start with .PHONY targets like deps (mix deps.get), db (docker compose up -d db), setup (depends on db, then mix ecto.setup) and server (depends on db, then iex -S mix phx.server). Since Docker Compose already handles starting the containers, you can add a healthcheck to the database service and use docker compose up -d --wait so the server target only runs once Postgres is actually ready. Remember that recipe lines need tabs, not spaces. If it grows beyond a handful of targets, mix aliases in mix.exs are a good alternative since they stay in Elixir.

mudasobwa

mudasobwa

Creator of Cure

You are after a simple bash script. Makefile is an overkill and misuse for this kind of task.

kristoffn

kristoffn

If your goal is to write tasks to set your project up, and not to learn the quirks of make, then I can highly recommend mise and mise tasks.

I’ve found it more usefull than make, because I can pin the tool versions (like databases) and mise installs them. Two advantages over make are the arguments and flags and the task descriptions. No need for a help task with awk magic, which in my experience go stale after a while as the Makefile changes and the flags make the invoked scripts tidier.

LostKobrakai

LostKobrakai

Another option imo is Introduction - Just Programmer's Manual. It’s like a makefile, but tries to actually be a task runner not a build system.

Stef-Verniers

Stef-Verniers OP

Hello,

Since I’m still learning a lot about Elixir, I’m not educated enough to answer in a proper way.
It’s just what I know because of my job. :confused:

Sorry for the late response!

Stef-Verniers

Stef-Verniers OP

That does look interesting. I’ll take a look at it!

Stef-Verniers

Stef-Verniers OP

Well yes, for local development, I can spin up my docker container from docker desktop en just type in the run phx.server command and those would be the most important tasks.

jc00ke

jc00ke

Came here to say this. mise (née rtx) was first a version manager like asdf. Then they added environment management like direnv and tasks like make and now you have 1 quite good tool and its ecosystem (hk, usage and fnox) to standardize on.

Over time I’ve ported all of our internal projects to mise. One big win was in our infrastructure project, where I was using make, direnv and aws-vault, where I was able to consolidate to mise + fnox with much better integration.

Anyway, it’s banger, highly rec’d.

Stef-Verniers

Stef-Verniers OP

Yeah, I looked into mise and decided to implement it in my project!

— All posts loaded —

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
itzmidinesh
Hi all, I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison....
New
yarrichar
I’m very new to Elixir, so sorry if this is a silly question: I am wondering what happens to the mailbox of a process when the machine i...
New
pragdave
How do I tell Hologram not to escape HTML when substituting into templates? {Textile.render(@product.long_description)} escapes the HTM...
New
Fl4m3Ph03n1x
Background When trying to execute mix release on a Windows 11 machine for a Phoenix project I get the following error: * assembling mark...
New
leoschweizer
Hi, we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
rlipscombe
I’d like to create a file with 600 permissions (rw-------), but there’s a race condition if I create it and then change the permissions. ...
New

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
raa-ziq
Hi everyone :waving_hand: I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New
kip
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews