Page 1 of 1

how to build from command line using Makefile?

Posted: Sat Sep 04, 2021 5:47 pm
by N7DR

I have a quite complex project that builds fine from the IDE; but I don't understand how to build the same project from the command line using the makefile generated by codelite.

The files in the top-level codelite directory are:

----
n7dr@shack20:~/cl$ ls -al
total 24
drwxr-xr-x 4 n7dr n7dr 4096 Mar 5 2020 .
drwxr-xr-x 34 n7dr n7dr 4096 Sep 4 07:13 ..
drwxr-xr-x 3 n7dr n7dr 4096 Sep 1 11:40 .codelite
drwxr-xr-x 4 n7dr n7dr 4096 Sep 2 06:54 drlog
-rw-r--r-- 1 n7dr n7dr 540 Sep 3 20:47 drlog.workspace
-rw-r--r-- 1 n7dr n7dr 288 Sep 3 20:43 Makefile
n7dr@shack20:~/cl$
----

I've tried various things to try to build the drlog project, but have not found the right magic incantation. What do I need to do to build the project?

The contents of Makefile are:

----
.PHONY: clean All

All:
@echo "----------Building project:[ drlog - Release ]----------"
@cd "drlog" && "$(MAKE)" -f "drlog.mk" PreBuild && "$(MAKE)" -f "drlog.mk"
clean:
@echo "----------Cleaning project:[ drlog - Release ]----------"
@cd "drlog" && "$(MAKE)" -f "drlog.mk" clean
----

Executing "make" produces:

----
n7dr@shack20:~/cl$ make
----------Building project:[ drlog - Release ]----------
make[1]: Entering directory '/home/n7dr/cl/drlog'
make[1]: echo: No such file or directory
make[1]: *** [drlog.mk:95: PreBuild] Error 127
make[1]: Leaving directory '/home/n7dr/cl/drlog'
make: *** [Makefile:5: All] Error 2
n7dr@shack20:~/cl$
----

So how do I build the project from the command line? Obviously, I'm misunderstanding something basic.


Re: how to build from command line using Makefile?

Posted: Sat Sep 04, 2021 6:02 pm
by eranif

CodeLite provides a command line utility called codelite-make you should use that instead of trying to figure out the Makefiles


Re: how to build from command line using Makefile?

Posted: Mon Sep 06, 2021 1:26 pm
by Jarod42

So it would be something like:

Code: Select all

codelite-make --workspace=drlog.workspace --project=MydrlogApp --config=Release --command=build --verbose --execute

Re: how to build from command line using Makefile?

Posted: Mon Sep 06, 2021 6:58 pm
by eranif

something like that.
try it and see if it works.

For example, to build CodeLite from a Windows terminal, I use this command:

Code: Select all

codelite-make.exe --workspace=CodeLiteIDE.workspace --config=Win_x64_Release --project=CodeLiteIDE --execute