how to build from command line using Makefile?

General questions regarding the usage of CodeLite
N7DR
CodeLite Enthusiast
Posts: 20
Joined: Sun Sep 01, 2019 12:57 am
Genuine User: Yes
IDE Question: C++
Contact:

how to build from command line using Makefile?

Post 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.

User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: how to build from command line using Makefile?

Post by eranif »

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

Make sure you have read the HOW TO POST thread
User avatar
Jarod42
CodeLite Expert
Posts: 240
Joined: Wed Sep 30, 2009 5:54 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: how to build from command line using Makefile?

Post by Jarod42 »

So it would be something like:

Code: Select all

codelite-make --workspace=drlog.workspace --project=MydrlogApp --config=Release --command=build --verbose --execute
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: how to build from command line using Makefile?

Post 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
Make sure you have read the HOW TO POST thread
Post Reply