tklauser / llmnrd

Link-Local Multicast Resolution (LLMNR) Daemon for Linux
GNU General Public License v2.0
44 stars 20 forks source link

Makefile: assign CC conditionally #24

Closed mpvader closed 6 years ago

mpvader commented 6 years ago

Hi,

first of all, my compliments. llmnrd looks to be a very nice, to the point tool. And does exactly what I was looking for.

See below commit, fixes an error like this:

$ make
  CC llmnr.c
llmnr.c:20:19: fatal error: ctype.h: No such file or directory
compilation terminated.
Makefile:81: recipe for target 'llmnr.o' failed
make: *** [llmnr.o] Error 1

In my env, CC is already defined, like this:

CC=arm-ve-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=/opt/venus/jethro-arm-cortexa8hf-neon/sysroots/cortexa8hf-vfp-neon-ve-linux-gnueabi
mpvader commented 6 years ago

ps, after making this pull request I figured out that make -e also works. Up to you to decide if the ?= is better or not. I don't have that much experience with Makefiles.

tklauser commented 6 years ago

Your change makes perfect sense and I pulled it as is. Thanks a lot!