2
0

Makefile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. PWD=$(shell pwd)
  2. INCS=-I$(PWD)/src/include
  3. DEBUG=-g -ggdb
  4. BASE_FLAGS=$(INCS) $(DEBUG) -fPIC
  5. PICKY=-O2
  6. CFLAGS=$(BASE_FLAGS) $(PICKY)
  7. CXXFLAGS=$(BASE_FLAGS)
  8. MYLIB=libscgi.a
  9. LIBS=
  10. LDFLAGS=-L.
  11. OBJS=src/scgi.o
  12. SRC=src/scgi.c src/scgi_oop.cpp
  13. HEADERS=src/include/scgi.h src/include/scgi_oop.h
  14. SOLINK=-shared -Xlinker -x
  15. # comment the next line to disable c++ (no swig mods for you then)
  16. OBJS += src/scgi_oop.o
  17. all: $(MYLIB) testclient testserver
  18. $(MYLIB): $(OBJS) $(HEADERS) $(SRC)
  19. ar rcs $(MYLIB) $(OBJS)
  20. ranlib $(MYLIB)
  21. %.o: %.c $(HEADERS)
  22. $(CC) $(CC_CFLAGS) $(CFLAGS) -c $< -o $@
  23. %.o: %.cpp $(HEADERS)
  24. $(CXX) $(CXX_CFLAGS) $(CXXFLAGS) -c $< -o $@
  25. testclient: $(MYLIB) testclient.c
  26. $(CC) $(CC_CFLAGS) $(CFLAGS) testclient.c -o testclient -lscgi $(LDFLAGS) $(LIBS)
  27. testserver: $(MYLIB) testserver.c
  28. $(CC) $(CC_CFLAGS) $(CFLAGS) testserver.c -o testserver -lscgi $(LDFLAGS) $(LIBS)
  29. clean:
  30. rm -f *.o src/*.o libscgi.a *~ src/*~ src/include/*~ testclient testserver
  31. $(MAKE) -C perl clean
  32. reswig: swigclean
  33. $(MAKE) -C perl reswig
  34. swigclean: clean
  35. $(MAKE) -C perl swigclean
  36. perlmod: $(MYLIB)
  37. $(MAKE) MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C perl
  38. perlmod-install: perlmod
  39. $(MAKE) -C perl install