1 2 3 ifeq ($(NEOTONIC_ROOT),) 4 NEOTONIC_ROOT = .. 5 endif 6 7 include $(NEOTONIC_ROOT)/rules.mk 8 9 CGI_LIB = $(LIB_DIR)libneo_cgi.a 10 CGI_SRC = cgiwrap.c cgi.c html.c date.c rfc2388.c 11 CGI_OBJ = $(CGI_SRC:%.c=%.o) 12 13 STATIC_EXE = cs_static.cgi 14 STATIC_SRC = static.c 15 STATIC_OBJ = $(STATIC_SRC:%.c=%.o) 16 STATIC_CSO = $(STATIC_EXE:%.cgi=%.cso) 17 18 CGICSTEST_EXE = cgi_cstest 19 CGICSTEST_SRC = cgi_cstest.c 20 CGICSTEST_OBJ = $(CGICSTEST_SRC:%.c=%.o) 21 22 DLIBS += -lneo_cgi -lneo_cs -lneo_utl # -lefence 23 24 TARGETS = $(CGI_LIB) $(STATIC_EXE) $(STATIC_CSO) $(CGICSTEST_EXE) 25 26 all: $(TARGETS) 27 28 $(CGI_LIB): $(CGI_OBJ) 29 $(AR) $@ $(CGI_OBJ) 30 $(RANLIB) $@ 31 32 $(STATIC_EXE): $(STATIC_OBJ) $(DEP_LIBS) 33 $(LD) $@ $(STATIC_OBJ) $(LDFLAGS) $(DLIBS) $(LIBS) 34 35 $(STATIC_CSO): $(STATIC_OBJ) $(DEP_LIBS) 36 $(LDSHARED) -o $@ $(STATIC_OBJ) $(LDFLAGS) $(DLIBS) $(LIBS) 37 38 $(CGICSTEST_EXE): $(CGICSTEST_OBJ) $(DEP_LIBS) 39 $(LD) $@ $(CGICSTEST_OBJ) $(LDFLAGS) $(DLIBS) $(LIBS) 40 41 install: all 42 $(NEOTONIC_ROOT)/mkinstalldirs $(DESTDIR)$(cs_includedir)/cgi 43 $(INSTALL) -m 644 cgi.h $(DESTDIR)$(cs_includedir)/cgi 44 $(INSTALL) -m 644 cgiwrap.h $(DESTDIR)$(cs_includedir)/cgi 45 $(INSTALL) -m 644 date.h $(DESTDIR)$(cs_includedir)/cgi 46 $(INSTALL) -m 644 html.h $(DESTDIR)$(cs_includedir)/cgi 47 $(INSTALL) -m 644 $(CGI_LIB) $(DESTDIR)$(libdir) 48 $(INSTALL) $(STATIC_EXE) $(DESTDIR)$(bindir) 49 50 clean: 51 $(RM) *.o 52 53 distclean: 54 $(RM) Makefile.depends $(TARGETS) *.o 55