top_targets ... Now I'm starting to get it.
I've been letting the Geo::ReadGRIB project simmer along for a while now. I've worked on a few other projects in the mean time. I even started and finished one, Games::Suduku. The main thing I needed to do is find out enough about ExtUtils::MakeMaker and the make files it creates. This means digging into /make/ again too. Recall that I want to compile a third party C program which my module code wall then use. I can't find any examples doing this anywhere so I had to discover a good way myself. Looks like the top_targets section is the place to do the compile: (In lib-wgrib/) sub MY::top_targets { ' all :: static pure_all :: static static :: wgrib$(LIB_EXT) wgrib$(LIB_EXT): $(C_FILES) --tab-- $(CC) -o wgrib wgrib.c --tab-- $(MKPATH) $(INST_ARCHAUTODIR) --tab-- $(CP) wgrib $(INST_ARCHAUTODIR)/wgrib '; } [/items/Perl] permanent link
.c$(OBJ_EXT): $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c # --- MakeMaker const_cccmd section: CCCMD = $(CC) -c $(INC) $(CCFLAGS) $(OPTIMIZE) \ $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION) \ $(XS_DEFINE_VERSION) CC: cc -c INC: CCFLAGS: -fno-strict-aliasing -I/usr/local/include OPTIMIZE: -O PERLTYPE: DEFINE_VERSION: -VERSION=\"0.10\" XS_DEFINE_VERSION: -DXS_VERSION=\"0.10\" -DPIC -fpic -/usr/local/lib/perl5/5.6.1/i386-freebsd/CORE wgrib.c [/items/Perl] permanent link