# Makefile # # compile SQL4.c with calls to MySQL's API # link with cgi-util.c which reads the GET or POST data from client # code file is SQL.cgi # # note the include and lib subdirectories # # usage: # make to compile/link # make clean to remove old object files # make install to make SQL4.cgi executable by others CC = gcc CFLAGS = -O2 -D__STDC__=0 -D__SPARC__ -D__SOLARIS__ INCLUDE = -I./include LIBS = -L./lib -lmysqlclient -lsocket -lnsl -lm PROG = SQL4.cgi SRCS=SQL4.c cgi-util.c OBJS=SQL4.o cgi-util.o all: $(PROG) clean: rm -f $(PROG); rm -f $(OBJS) install: chmod go+x $(PROG) $(PROG) : $(OBJS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(OBJS) : $(SRCS) $(CC) $(CFLAGS) $(INCLUDE) -c $*.c