Home | History | Annotate | Download | only in python
      1 
      2 
      3 ifeq ($(NEOTONIC_ROOT),)
      4 NEOTONIC_ROOT = ..
      5 endif
      6 
      7 include $(NEOTONIC_ROOT)/rules.mk
      8 
      9 NEO_UTIL_SO = neo_cgi.so
     10 NEO_UTIL_PYD = neo_cgi.pyd
     11 NEO_UTIL_SRC = neo_cgi.c neo_util.c neo_cs.c
     12 NEO_UTIL_OBJ = $(NEO_UTIL_SRC:%.c=%.o)
     13 
     14 CFLAGS += $(PYTHON_INC)
     15 DLIBS += -lneo_cgi -lneo_cs -lneo_utl 
     16 LIBS += $(DLIBS) $(DB2_LIB)
     17 
     18 ifeq ($(USE_MINGW32),1)
     19 TARGETS = $(NEO_UTIL_PYD)
     20 else
     21 TARGETS = $(NEO_UTIL_SO)
     22 endif
     23 
     24 all: $(TARGETS)
     25 
     26 $(NEO_UTIL_SO): setup.py $(NEO_UTIL_SRC) $(DEP_LIBS)
     27 	rm -f $(NEO_UTIL_SO)
     28 	CC="$(CC)" LDSHARED="$(LDSHARED)" $(PYTHON) setup.py build_ext --inplace
     29 
     30 OLD_NEO_UTIL_SO:
     31 	$(LDSHARED) -o $@ $(LDFLAGS) $(NEO_UTIL_OBJ) $(LIBS)
     32 
     33 setup:
     34 	$(PYTHON) setup.py build_ext --inplace
     35 
     36 $(NEO_UTIL_PYD): $(NEO_UTIL_OBJ) $(DEP_LIBS)
     37 	dllwrap --dllname neo_cgi.pyd --driver-name gcc \
     38 		--def neo_cgi.def -o neo_cgi.pyd \
     39 		$(NEO_UTIL_OBJ) -s --entry _DllMain@12 \
     40 		--target=i386-mingw32 \
     41 		$(LDFLAGS) $(PYTHON_LIB) $(LIBS)
     42 
     43 install: all
     44 	$(NEOTONIC_ROOT)/mkinstalldirs $(DESTDIR)$(PYTHON_SITE)
     45 	$(INSTALL) $(TARGETS) $(DESTDIR)$(PYTHON_SITE)
     46 
     47 clean:
     48 	$(RM) *.o
     49 
     50 distclean:
     51 	$(RM) Makefile.depends $(TARGETS) *.o
     52 	$(RM) -r build
     53