Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile: fix DEBUGAD defines adjustment. #1822

Merged
merged 1 commit into from
Jan 16, 2020

Conversation

cpu
Copy link
Contributor

@cpu cpu commented Jan 16, 2020

Providing DEBUGAD=1 to the Makefile environment should add -DDEBUGAD to the DEFINES used when building the ossec-analysisd binary. Prev. to this commit a typo in the makefile would result in an error in compilation when using DEBUGAD=1:

~/Code/ossec-hids-clean/src$ make -j4 V=1 DEBUG=1 DEBUGAD=1 TARGET=server PREFIX=/tmp/ossec-rootdir
cc -I./external/compat -g -DMAX_AGENTS=2048 -DOSSECHIDS -DDEFAULTDIR=\"/tmp/ossec-rootdir\" -DUSER=\"ossec\" -DREMUSER=\"ossecr\" -DGROUPGLOBAL=\"ossec\" -DMAILUSER=\"ossecm\" -DLinux -DINOTIFY_ENABLED +DDEBUGAD -DZLIB_SYSTEM -DUSE_PCRE2_JIT -DLIBOPENSSL_ENABLED -Wall -Wextra -I./ -I./headers/ -c external/cJSON/cJSON.c -o external/cJSON/cJSON.o
cc -I./external/compat -g -DMAX_AGENTS=2048 -DOSSECHIDS -DDEFAULTDIR=\"/tmp/ossec-rootdir\" -DUSER=\"ossec\" -DREMUSER=\"ossecr\" -DGROUPGLOBAL=\"ossec\" -DMAILUSER=\"ossecm\" -DLinux -DINOTIFY_ENABLED +DDEBUGAD -DZLIB_SYSTEM -DUSE_PCRE2_JIT -DLIBOPENSSL_ENABLED -Wall -Wextra -I./ -I./headers/ -DARGV0=\"ossec-maild\" -c os_maild/maild.c -o os_maild/maild.o
cc -I./external/compat -g -DMAX_AGENTS=2048 -DOSSECHIDS -DDEFAULTDIR=\"/tmp/ossec-rootdir\" -DUSER=\"ossec\" -DREMUSER=\"ossecr\" -DGROUPGLOBAL=\"ossec\" -DMAILUSER=\"ossecm\" -DLinux -DINOTIFY_ENABLED +DDEBUGAD -DZLIB_SYSTEM -DUSE_PCRE2_JIT -DLIBOPENSSL_ENABLED -Wall -Wextra -I./ -I./headers/ -DARGV0=\"ossec-maild\" -c os_maild/sendmail.c -o os_maild/sendmail.o
cc -I./external/compat -g -DMAX_AGENTS=2048 -DOSSECHIDS -DDEFAULTDIR=\"/tmp/ossec-rootdir\" -DUSER=\"ossec\" -DREMUSER=\"ossecr\" -DGROUPGLOBAL=\"ossec\" -DMAILUSER=\"ossecm\" -DLinux -DINOTIFY_ENABLED +DDEBUGAD -DZLIB_SYSTEM -DUSE_PCRE2_JIT -DLIBOPENSSL_ENABLED -Wall -Wextra -I./ -I./headers/ -DARGV0=\"ossec-maild\" -c os_maild/sendcustomemail.c -o os_maild/sendcustomemail.o
cc: error: +DDEBUGAD: No such file or directory
cc: error: +DDEBUGAD: No such file or directory
cc: error: +DDEBUGAD: No such file or directory
cc: error: +DDEBUGAD: No such file or directory
Makefile:752: recipe for target 'external/cJSON/cJSON.o' failed
make: *** [external/cJSON/cJSON.o] Error 1
make: *** Waiting for unfinished jobs....
Makefile:926: recipe for target 'os_maild/maild.o' failed
make: *** [os_maild/maild.o] Error 1
Makefile:926: recipe for target 'os_maild/sendmail.o' failed
make: *** [os_maild/sendmail.o] Error 1
Makefile:926: recipe for target 'os_maild/sendcustomemail.o' failed
make: *** [os_maild/sendcustomemail.o] Error 1

Providing `DEBUGAD=1` to the Makefile environment should add `-DDEBUGAD`
to the `DEFINES` used when building the `ossec-analysisd` binary. Prev.
to this commit a typo in the makefile would result in an error in
compilation when using `DEBUGAD=1`:

```
~/Code/ossec-hids-clean/src$ make -j4 V=1 DEBUG=1 DEBUGAD=1 TARGET=server PREFIX=/tmp/ossec-rootdir
cc -I./external/compat -g -DMAX_AGENTS=2048 -DOSSECHIDS -DDEFAULTDIR=\"/tmp/ossec-rootdir\" -DUSER=\"ossec\" -DREMUSER=\"ossecr\" -DGROUPGLOBAL=\"ossec\" -DMAILUSER=\"ossecm\" -DLinux -DINOTIFY_ENABLED +DDEBUGAD -DZLIB_SYSTEM -DUSE_PCRE2_JIT -DLIBOPENSSL_ENABLED -Wall -Wextra -I./ -I./headers/ -c external/cJSON/cJSON.c -o external/cJSON/cJSON.o
cc -I./external/compat -g -DMAX_AGENTS=2048 -DOSSECHIDS -DDEFAULTDIR=\"/tmp/ossec-rootdir\" -DUSER=\"ossec\" -DREMUSER=\"ossecr\" -DGROUPGLOBAL=\"ossec\" -DMAILUSER=\"ossecm\" -DLinux -DINOTIFY_ENABLED +DDEBUGAD -DZLIB_SYSTEM -DUSE_PCRE2_JIT -DLIBOPENSSL_ENABLED -Wall -Wextra -I./ -I./headers/ -DARGV0=\"ossec-maild\" -c os_maild/maild.c -o os_maild/maild.o
cc -I./external/compat -g -DMAX_AGENTS=2048 -DOSSECHIDS -DDEFAULTDIR=\"/tmp/ossec-rootdir\" -DUSER=\"ossec\" -DREMUSER=\"ossecr\" -DGROUPGLOBAL=\"ossec\" -DMAILUSER=\"ossecm\" -DLinux -DINOTIFY_ENABLED +DDEBUGAD -DZLIB_SYSTEM -DUSE_PCRE2_JIT -DLIBOPENSSL_ENABLED -Wall -Wextra -I./ -I./headers/ -DARGV0=\"ossec-maild\" -c os_maild/sendmail.c -o os_maild/sendmail.o
cc -I./external/compat -g -DMAX_AGENTS=2048 -DOSSECHIDS -DDEFAULTDIR=\"/tmp/ossec-rootdir\" -DUSER=\"ossec\" -DREMUSER=\"ossecr\" -DGROUPGLOBAL=\"ossec\" -DMAILUSER=\"ossecm\" -DLinux -DINOTIFY_ENABLED +DDEBUGAD -DZLIB_SYSTEM -DUSE_PCRE2_JIT -DLIBOPENSSL_ENABLED -Wall -Wextra -I./ -I./headers/ -DARGV0=\"ossec-maild\" -c os_maild/sendcustomemail.c -o os_maild/sendcustomemail.o
cc: error: +DDEBUGAD: No such file or directory
cc: error: +DDEBUGAD: No such file or directory
cc: error: +DDEBUGAD: No such file or directory
cc: error: +DDEBUGAD: No such file or directory
Makefile:752: recipe for target 'external/cJSON/cJSON.o' failed
make: *** [external/cJSON/cJSON.o] Error 1
make: *** Waiting for unfinished jobs....
Makefile:926: recipe for target 'os_maild/maild.o' failed
make: *** [os_maild/maild.o] Error 1
Makefile:926: recipe for target 'os_maild/sendmail.o' failed
make: *** [os_maild/sendmail.o] Error 1
Makefile:926: recipe for target 'os_maild/sendcustomemail.o' failed
make: *** [os_maild/sendcustomemail.o] Error 1
```
@ddpbsd ddpbsd merged commit 9260820 into ossec:master Jan 16, 2020
@ddpbsd
Copy link
Member

ddpbsd commented Jan 16, 2020

Thanks for the PR! I'll be looking at the others too, just slower.

@cpu cpu deleted the cpu-fix-makefile-debugad branch January 16, 2020 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants