in reply to Re^2: Blending perl and C (two approaches)
in thread Blending perl and C (two approaches)
The perl-relevant part of the Makefile under Linux or *BSD would look like:
... VPATH = $(MYSOURCES) : $(MYTOOLS) ... #Linux + Freebsd: use the magic configurator "ExtUtils::Embed" PERLCC=`perl -MExtUtils::Embed -e perl_inc` PERLLD=`perl -MExtUtils::Embed -e ldopts -- -std` PLSTATIC= # -static # if static libperl.a, set this to -static, otherwise to (none) CXXFLAGS=-O3 COMPILE.cxx=$(CXX) $(CFLAGS) $(CXXFLAGS) $(PERLCC) -I$(MYHEADERS) -c .cxx.o: $(COMPILE.cxx) $< -o $(@F) $(EXE): $(F_MYSOURCE) $(F_MYTOOLS) Makefile $(CXX) -o $@ $(F_MYSOURCE) $(F_MYTOOLS) $(PERLLD) $(PLSTATIC) -lst +dc++ -s ...
The 'MYHEADERS', 'F_MYSOURCE', 'F_MYTOOLS' etc. designate the apps source files and directories (and are set elsewhere), the Perl-stuff goes into 'PERLCC' (headers) and 'PERLLD' (libs).
This will magically construct a perl.lib linked app ;-).
Regards
mwa
|
|---|