2005-02-25 03:27:54 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# microperl
|
|
|
|
#
|
|
|
|
#############################################################
|
2006-11-24 10:49:16 +01:00
|
|
|
MICROPERL_MAJ=5
|
|
|
|
MICROPERL_VER=$(MICROPERL_MAJ).8.8
|
2005-02-25 03:27:54 +01:00
|
|
|
MICROPERL_SOURCE=perl-$(MICROPERL_VER).tar.bz2
|
2006-11-17 16:43:51 +01:00
|
|
|
MICROPERL_CAT:=$(BZCAT)
|
2005-02-25 03:27:54 +01:00
|
|
|
MICROPERL_SITE=ftp://ftp.cpan.org/pub/CPAN/src/5.0
|
|
|
|
MICROPERL_DIR=$(BUILD_DIR)/perl-$(MICROPERL_VER)
|
|
|
|
|
2006-12-15 14:34:29 +01:00
|
|
|
MICROPERL_MODS_DIR=/usr/lib/perl$(MICROPERL_MAJ)/$(MICROPERL_VER)
|
|
|
|
MICROPERL_MODS=$(subst ",,$(BR2_PACKAGE_MICROPERL_MODULES))
|
|
|
|
# ")
|
|
|
|
|
2005-02-25 03:27:54 +01:00
|
|
|
$(DL_DIR)/$(MICROPERL_SOURCE):
|
|
|
|
$(WGET) -P $(DL_DIR) $(MICROPERL_SITE)/$(MICROPERL_SOURCE)
|
|
|
|
|
|
|
|
$(MICROPERL_DIR)/.source: $(DL_DIR)/$(MICROPERL_SOURCE)
|
2006-11-17 16:43:51 +01:00
|
|
|
$(MICROPERL_CAT) $(DL_DIR)/$(MICROPERL_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
|
2006-11-24 10:49:16 +01:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(MICROPERL_DIR)/.configured: $(MICROPERL_DIR)/.source
|
|
|
|
(cd $(MICROPERL_DIR) ; chmod u+w uconfig.h ; . ./uconfig.sh ; \
|
|
|
|
make -f Makefile.micro regen_uconfig ; \
|
2006-12-15 14:34:29 +01:00
|
|
|
$(SED) 's,PRIVLIB ".*,PRIVLIB "/$(MICROPERL_MODS_DIR)",' \
|
|
|
|
-e 's,PRIVLIB_EXP ".*,PRIVLIB_EXP "$(MICROPERL_MODS_DIR)",' \
|
|
|
|
-e 's,BIN ".*,BIN "/usr/bin",' \
|
|
|
|
./uconfig.h ; \
|
2006-11-24 10:49:16 +01:00
|
|
|
)
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(MICROPERL_DIR)/microperl: $(MICROPERL_DIR)/.configured
|
|
|
|
$(MAKE) -f Makefile.micro CC=$(TARGET_CC) \
|
|
|
|
OPTIMIZE="$(TARGET_CFLAGS)" -C $(MICROPERL_DIR)
|
2005-02-25 03:27:54 +01:00
|
|
|
|
|
|
|
$(TARGET_DIR)/usr/bin/microperl: $(MICROPERL_DIR)/microperl
|
2006-12-15 14:34:29 +01:00
|
|
|
ifneq ($(MICROPERL_MODS),)
|
|
|
|
(cd $(MICROPERL_DIR) ; \
|
|
|
|
for i in $(patsubst %,$(TARGET_DIR)/$(MICROPERL_MODS_DIR)/%,$(dir $(MICROPERL_MODS))) ; do \
|
|
|
|
[ -d $$i ] || mkdir -p $$i ; \
|
|
|
|
done ; \
|
|
|
|
for i in $(MICROPERL_MODS) ; do \
|
|
|
|
cp -dpf lib/$$i $(TARGET_DIR)/$(MICROPERL_MODS_DIR)/$$i ; \
|
|
|
|
done; \
|
|
|
|
)
|
|
|
|
endif
|
2005-02-25 03:27:54 +01:00
|
|
|
cp -dpf $(MICROPERL_DIR)/microperl $(TARGET_DIR)/usr/bin/microperl
|
|
|
|
|
|
|
|
microperl: uclibc $(TARGET_DIR)/usr/bin/microperl
|
|
|
|
|
|
|
|
microperl-source: $(DL_DIR)/$(MICROPERL_SOURCE)
|
|
|
|
|
|
|
|
microperl-clean:
|
2006-12-15 14:34:29 +01:00
|
|
|
rm -rf $(TARGET_DIR)/usr/bin/microperl $(TARGET_DIR)/$(MICROPERL_MODS_DIR)
|
|
|
|
-rmdir $(TARGET_DIR)/usr/lib/perl$(MICROPERL_MAJ)
|
|
|
|
-$(MAKE) -C $(MICROPERL_DIR) -f Makefile.micro clean
|
2005-02-25 03:27:54 +01:00
|
|
|
|
|
|
|
microperl-dirclean:
|
|
|
|
rm -rf $(MICROPERL_DIR)
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Toplevel Makefile options
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
ifeq ($(strip $(BR2_PACKAGE_MICROPERL)),y)
|
|
|
|
TARGETS+=microperl
|
|
|
|
endif
|