Hi guys, I have never really done anything in C before, but I was using a certain dialect of LISP that compiles into C. The problem is the tool to make the makefile and organize everything does not work at all. So I have 3 C files that have all the compiled code that I have written, along with many of the library source files and header files that I should include. The problem is there are alot of files and I dont really know which ones exactly are needed (because I wrote it in this LISP code). When I use the interpreter on the C code that comes with the language it works fine so I know it runs ok but It would take me forever to figure out how the entire interpreter works. So far I have this in my Makefile:
And I have those 5 c source files in the folder. So I get a bunch of expected "undefined reference to" errors. Is there a way to just set a search path like I do for C++ code to find all of the code I need, I know where everything is including the headers I just dont know how to put it all together. Maybe this is confusing to others too but if anyone can give any suggestions it would be greatly appreciated. I just need this to work on
CC = gcc -std=gnu99
LUSHFLAGS = -DNOLISP -DNO_DEBUG -Wall -O3 -march=nocona -mmmx -msse -pthread
X_CFLAGS = -I/usr/include/freetype2
X_LIBS = -lXft -lSM -lICE -lX11
LIBS = -lm -lc
DEFS = -DHAVE_CONFIG_H
MAIN = -DC_propogate=main
OBJS = lush_runtime.o check_func.o dsource_mnist2.o lenet5_fprop.o test_fprop.o
test: ${OBJS}
$(CC) -o test ${OBJS} ${LIBS}
.c.o:
${CC} ${MAIN} ${DEFS} ${X_CFLAGS} ${LUSHFLAGS} -c $<
And I have those 5 c source files in the folder. So I get a bunch of expected "undefined reference to" errors. Is there a way to just set a search path like I do for C++ code to find all of the code I need, I know where everything is including the headers I just dont know how to put it all together. Maybe this is confusing to others too but if anyone can give any suggestions it would be greatly appreciated. I just need this to work on