Make a makefile for cjson code with -lcjson for json parser in c
问题 I'm very new to the makefiles. I'm compiling the c code file which contains cJson library from terminal using command gcc -test1.c -o test -lcjson with -lcjson at last and its running perfectly. But how to compile the same code using makefile as I have to add -lcjson at last. if I'm using without -lcjson I'm getting error /tmp/cc4ESrx1.o: In function `parse_json': test1.c:(.text+0x2d): undefined reference to `cJSON_Parse' test1.c:(.text+0x42): undefined reference to `cJSON_GetObjectItem'