264 lines
6.4 KiB
Makefile
264 lines
6.4 KiB
Makefile
#
|
|
# Project: pcre
|
|
#
|
|
# Created on: 30-07-2022 14:40:03
|
|
#
|
|
#
|
|
|
|
###################################################################
|
|
##
|
|
##//// Objects
|
|
##
|
|
###################################################################
|
|
|
|
libpcre_OBJ := \
|
|
pcre_byte_order.o pcre_chartables.o pcre_compile.o \
|
|
pcre_config.o pcre_dfa_exec.o pcre_exec.o \
|
|
pcre_fullinfo.o pcre_get.o pcre_globals.o \
|
|
pcre_jit_compile.o pcre_maketables.o \
|
|
pcre_newline.o pcre_ord2utf8.o pcre_printint.o \
|
|
pcre_refcount.o pcre_string_utils.o pcre_study.o \
|
|
pcre_tables.o pcre_ucd.o pcre_valid_utf8.o \
|
|
pcre_version.o pcre_xclass.o
|
|
# pcre_jit_test.o
|
|
|
|
|
|
libpcre-posix_OBJ := \
|
|
pcreposix.o
|
|
|
|
|
|
pcretest_OBJ := \
|
|
pcretest.o
|
|
|
|
|
|
pcregrep_OBJ := \
|
|
pcregrep.o
|
|
|
|
|
|
pcredemo_OBJ := \
|
|
pcredemo.o
|
|
|
|
|
|
###################################################################
|
|
##
|
|
##//// Variables and Environment
|
|
##
|
|
###################################################################
|
|
|
|
MCRT := -mcrt=newlib
|
|
ifeq ($(USE_CLIB2), yes)
|
|
MCRT := -mcrt=clib2
|
|
endif
|
|
|
|
CC := gcc:bin/gcc
|
|
|
|
INCPATH := -I.
|
|
|
|
CFLAGS := $(MCRT) $(INCPATH) -Wall -Wwrite-strings -Wno-unused-variable -Wno-unused-function -DHAVE_CONFIG_H
|
|
|
|
|
|
###################################################################
|
|
##
|
|
##//// General rules
|
|
##
|
|
###################################################################
|
|
|
|
.PHONY: all all-before all-after clean clean-custom realclean
|
|
|
|
all: all-before libpcre.a libpcre-posix.a all-after
|
|
|
|
all-before:
|
|
# You can add rules here to execute before the project is built
|
|
|
|
all-after:
|
|
# You can add rules here to execute after the project is built
|
|
|
|
tests: pcretest pcregrep
|
|
|
|
clean: clean-custom
|
|
@echo "Cleaning compiler objects..."
|
|
@rm -f $(libpcre_OBJ) $(libpcre-posix_OBJ) $(pcretest_OBJ) $(pcregrep_OBJ) $(pcredemo_OBJ)
|
|
|
|
cleanall: clean
|
|
@echo "Cleaning compiler targets..."
|
|
@rm -f libpcre.a libpcre-posix.a pcretest pcregrep pcredemo
|
|
|
|
|
|
###################################################################
|
|
##
|
|
##//// Targets
|
|
##
|
|
###################################################################
|
|
|
|
libpcre.a: $(libpcre_OBJ)
|
|
ar -rcs libpcre.a $(libpcre_OBJ)
|
|
ranlib libpcre.a
|
|
|
|
libpcre-posix.a: $(libpcre-posix_OBJ)
|
|
ar -rcs libpcre-posix.a $(libpcre-posix_OBJ)
|
|
ranlib libpcre-posix.a
|
|
|
|
pcretest: $(pcretest_OBJ)
|
|
@echo "Linking pcretest"
|
|
@gcc:bin/gcc $(MCRT) -o pcretest $(pcretest_OBJ) -L. -lpcre -lpcre-posix
|
|
@echo "Removing stale debug target: pcretest"
|
|
@rm -f pcretest.debug
|
|
|
|
pcregrep: $(pcregrep_OBJ)
|
|
@echo "Linking pcregrep"
|
|
@gcc:bin/gcc $(MCRT) -o pcregrep $(pcregrep_OBJ) -L. -lpcre
|
|
@echo "Removing stale debug target: pcregrep"
|
|
@rm -f pcregrep.debug
|
|
|
|
pcredemo: $(pcredemo_OBJ)
|
|
@echo "Linking pcredemo"
|
|
@gcc:bin/gcc $(MCRT) -o pcredemo $(pcredemo_OBJ) -L. -lpcre
|
|
@echo "Removing stale debug target: pcredemo"
|
|
@rm -f pcredemo.debug
|
|
|
|
###################################################################
|
|
##
|
|
##//// Standard rules
|
|
##
|
|
###################################################################
|
|
|
|
# A default rule to make all the objects listed below
|
|
# because we are hiding compiler commands from the output
|
|
|
|
.c.o:
|
|
@echo "Compiling $<"
|
|
@$(CC) -c $< -o $*.o $(CFLAGS)
|
|
|
|
pcre_byte_order.o: pcre_byte_order.c config.h pcre_internal.h \
|
|
pcre.h
|
|
|
|
pcre_compile.o: pcre_compile.c config.h pcre_internal.h \
|
|
pcre.h ucp.h
|
|
|
|
pcre_config.o: pcre_config.c config.h pcre_internal.h \
|
|
pcre.h
|
|
|
|
pcre_dfa_exec.o: pcre_dfa_exec.c config.h pcre_internal.h \
|
|
pcre.h
|
|
|
|
pcre_exec.o: pcre_exec.c config.h pcre_internal.h \
|
|
pcre.h
|
|
|
|
pcre_fullinfo.o: pcre_fullinfo.c config.h pcre_internal.h \
|
|
pcre.h
|
|
|
|
pcre_get.o: pcre_get.c config.h pcre_internal.h \
|
|
pcre.h
|
|
|
|
pcre_globals.o: pcre_globals.c config.h pcre_internal.h \
|
|
pcre.h
|
|
|
|
pcre_jit_compile.o: pcre_jit_compile.c config.h pcre_internal.h \
|
|
pcre.h ucp.h sljit/sljitLir.c \
|
|
sljit/sljitLir.h sljit/sljitConfig.h sljit/sljitConfigInternal.h \
|
|
sljit/sljitUtils.c
|
|
|
|
pcre_jit_test.o: pcre_jit_test.c config.h pcre.h \
|
|
pcre_internal.h
|
|
|
|
pcre_chartables.o: pcre_chartables.c config.h pcre_internal.h \
|
|
pcre.h
|
|
|
|
pcre_maketables.o: pcre_maketables.c
|
|
|
|
pcre_newline.o: pcre_newline.c config.h pcre_internal.h \
|
|
pcre.h
|
|
|
|
pcre_ord2utf8.o: pcre_ord2utf8.c config.h pcre_internal.h \
|
|
pcre.h
|
|
|
|
pcre_printint.o: pcre_printint.c config.h pcre.h \
|
|
pcre_internal.h
|
|
|
|
pcre_refcount.o: pcre_refcount.c config.h pcre_internal.h \
|
|
pcre.h
|
|
|
|
pcre_string_utils.o: pcre_string_utils.c config.h pcre_internal.h \
|
|
pcre.h
|
|
|
|
pcre_study.o: pcre_study.c config.h pcre_internal.h \
|
|
pcre.h
|
|
|
|
pcre_tables.o: pcre_tables.c config.h pcre_internal.h \
|
|
pcre.h
|
|
|
|
pcre_ucd.o: pcre_ucd.c config.h pcre_internal.h \
|
|
pcre.h
|
|
|
|
pcre_valid_utf8.o: pcre_valid_utf8.c config.h pcre_internal.h \
|
|
pcre.h
|
|
|
|
pcre_version.o: pcre_version.c config.h pcre_internal.h \
|
|
pcre.h
|
|
|
|
pcre_xclass.o: pcre_xclass.c config.h pcre_internal.h \
|
|
pcre.h
|
|
|
|
pcredemo.o: pcredemo.c
|
|
|
|
pcregrep.o: pcregrep.c config.h
|
|
|
|
pcreposix.o: pcreposix.c config.h pcre.h \
|
|
pcre_internal.h ucp.h
|
|
|
|
pcretest.o: pcretest.c config.h pcre.h \
|
|
pcre_internal.h ucp.h pcre_tables.c \
|
|
pcre_ucd.c
|
|
|
|
dftables.o: dftables.c config.h pcre_internal.h \
|
|
pcre.h ucp.h
|
|
|
|
|
|
###################################################################
|
|
##
|
|
##//// Custom rules
|
|
##
|
|
###################################################################
|
|
|
|
|
|
runtests: libpcre.a libpcre-posix.a pcretest pcregrep
|
|
sh RunTest
|
|
sh RunGrepTest
|
|
|
|
release:
|
|
@echo "Create release folders..."
|
|
@mkdir -p release/local/newlib/lib release/local/clib2/lib release/local/Documentation/pcre release/local/common/include
|
|
|
|
@echo "Building newlib based libraries..."
|
|
@make -f Makefile.os4 all
|
|
@cp libpcre.a release/local/newlib/lib/
|
|
@cp libpcre-posix.a release/local/newlib/lib/
|
|
|
|
@echo "Clean build and libraries files..."
|
|
@make -f Makefile.os4 cleanall
|
|
|
|
@echo "Building clib2 based libraries..."
|
|
@make -f Makefile.os4 all USE_CLIB2=yes
|
|
@cp libpcre.a release/local/clib2/lib/
|
|
@cp libpcre-posix.a release/local/clib2/lib/
|
|
|
|
@echo "Copy the necessary files..."
|
|
@cp pcre.h release/local/common/include/
|
|
@cp pcreposix.h release/local/common/include/
|
|
@cp COPYING release/local/Documentation/pcre/
|
|
@cp LICENCE release/local/Documentation/pcre/
|
|
@cp README release/local/Documentation/pcre/
|
|
@cp README-OS4.md release/local/Documentation/pcre/
|
|
|
|
@echo "Clean build and libraries files..."
|
|
@make -f Makefile.os4 cleanall
|
|
|
|
@echo "Creating the lha release file..."
|
|
@rm -f pcre.lha
|
|
@lha -aeqr3 a pcre.lha release/
|
|
|
|
@rm -rf release
|
|
|
|
###################################################################
|
|
|