"Fossies" - the Fresh Open Source Software Archive

Member "seed7/src/mk_icc.mak" (10 Feb 2021, 13930 Bytes) of package /linux/misc/seed7_05_20210223.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Make source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "mk_icc.mak": 05_20210130_vs_05_20210223.

    1 # Makefile for linux/bsd/unix and icc. Commands executed by: bash
    2 # To compile use a command shell and call:
    3 #   make -f mk_icc.mak depend
    4 #   make -f mk_icc.mak
    5 # If you are under windows you should use MinGW with mk_mingw.mak, mk_nmake.mak or mk_msys.mak instead.
    6 
    7 # CFLAGS =
    8 # CFLAGS = -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith
    9 # CFLAGS = -O2 -fomit-frame-pointer -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith
   10 # CFLAGS = -O2 -g -Wall -Wextra -Wswitch-default -Wswitch-enum -Wcast-qual -Waggregate-return -Wwrite-strings -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -Wmissing-noreturn -Wno-multichar -Wc++-compat
   11 # CFLAGS = -O2 -g -x c++ -Wall -Wextra -Wswitch-default -Wswitch-enum -Wcast-qual -Waggregate-return -Wwrite-strings -Winline -Wconversion -Wshadow -Wpointer-arith -Wmissing-noreturn -Wno-multichar
   12 # CFLAGS = -O2 -fomit-frame-pointer -Wall -Wextra -Wswitch-default -Wcast-qual -Waggregate-return -Wwrite-strings -Winline -Wconversion -Wshadow -Wpointer-arith -Wmissing-noreturn -Wno-multichar
   13 # CFLAGS = -O2 -g -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -ftrapv
   14 # CFLAGS = -O2 -g -x c++ -Wall -Winline -Wconversion -Wshadow -Wpointer-arith
   15 # CFLAGS = -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -ftrapv
   16 CFLAGS = -O2 -g -ffunction-sections -fdata-sections -fp-model precise -fp-model source -mp1 $(INCLUDE_OPTIONS) -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith
   17 # CFLAGS = -O2 -g -ffunction-sections -fdata-sections -fp-model precise -fp-model source -mp1 $(INCLUDE_OPTIONS) -Wall -Winline -Wconversion -Wshadow -Wpointer-arith
   18 # CFLAGS = -O2 -g -std=c99 -D_POSIX_SOURCE -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith
   19 # CFLAGS = -O2 -g -Wall -Winline -Wconversion -Wshadow -Wpointer-arith
   20 # CFLAGS = -O2 -g -Wall
   21 # CFLAGS = -O2 -g -pg -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith
   22 # CFLAGS = -O2 -fomit-frame-pointer -funroll-loops -Wall
   23 # CFLAGS = -O2 -funroll-loops -Wall -pg
   24 LDFLAGS = -Wl,--gc-sections
   25 # LDFLAGS = -pg
   26 # LDFLAGS = -pg -lc_p
   27 SYSTEM_LIBS = -lm
   28 # SYSTEM_LIBS = -lm -lgmp
   29 # SYSTEM_LIBS = -lm_p -lc_p
   30 # SYSTEM_DRAW_LIBS is defined in the file "macros". The program chkccomp.c writes it to "macros" when doing "make depend".
   31 # SYSTEM_CONSOLE_LIBS is defined in the file "macros". The program chkccomp.c writes it to "macros" when doing "make depend".
   32 # SYSTEM_DATABASE_LIBS is defined in the file "macros". The program chkccomp.c writes it to "macros" when doing "make depend".
   33 SEED7_LIB = seed7_05.a
   34 DRAW_LIB = s7_draw.a
   35 CONSOLE_LIB = s7_con.a
   36 DATABASE_LIB = s7_db.a
   37 COMP_DATA_LIB = s7_data.a
   38 COMPILER_LIB = s7_comp.a
   39 ALL_S7_LIBS = ../bin/$(COMPILER_LIB) ../bin/$(COMP_DATA_LIB) ../bin/$(DRAW_LIB) ../bin/$(CONSOLE_LIB) ../bin/$(DATABASE_LIB) ../bin/$(SEED7_LIB)
   40 # CC = icpc
   41 CC = icc
   42 AR = ar
   43 
   44 MOBJ = s7.o
   45 POBJ = runerr.o option.o primitiv.o
   46 LOBJ = actlib.o arrlib.o biglib.o binlib.o blnlib.o bstlib.o chrlib.o cmdlib.o conlib.o dcllib.o \
   47        drwlib.o enulib.o fillib.o fltlib.o hshlib.o intlib.o itflib.o kbdlib.o lstlib.o pcslib.o \
   48        pollib.o prclib.o prglib.o reflib.o rfllib.o sctlib.o setlib.o soclib.o sqllib.o strlib.o \
   49        timlib.o typlib.o ut8lib.o
   50 EOBJ = exec.o doany.o objutl.o
   51 AOBJ = act_comp.o prg_comp.o analyze.o syntax.o token.o parser.o name.o type.o \
   52        expr.o atom.o object.o scanner.o literal.o numlit.o findid.o \
   53        error.o infile.o libpath.o symbol.o info.o stat.o fatal.o match.o
   54 GOBJ = syvarutl.o traceutl.o actutl.o executl.o blockutl.o \
   55        entutl.o identutl.o chclsutl.o arrutl.o
   56 ROBJ = arr_rtl.o bln_rtl.o bst_rtl.o chr_rtl.o cmd_rtl.o con_rtl.o dir_rtl.o drw_rtl.o fil_rtl.o \
   57        flt_rtl.o hsh_rtl.o int_rtl.o itf_rtl.o pcs_rtl.o set_rtl.o soc_rtl.o sql_rtl.o str_rtl.o \
   58        tim_rtl.o ut8_rtl.o heaputl.o numutl.o sigutl.o striutl.o
   59 DOBJ = big_rtl.o big_gmp.o cmd_unx.o dir_win.o dll_unx.o fil_unx.o pcs_unx.o pol_unx.o soc_none.o \
   60        tim_unx.o
   61 OBJ = $(MOBJ)
   62 SEED7_LIB_OBJ = $(ROBJ) $(DOBJ)
   63 DRAW_LIB_OBJ = gkb_rtl.o drw_x11.o gkb_x11.o fwd_x11.o
   64 CONSOLE_LIB_OBJ = kbd_rtl.o con_inf.o kbd_inf.o kbd_poll.o trm_inf.o trm_cap.o fwd_term.o
   65 DATABASE_LIB_OBJ = sql_base.o sql_db2.o sql_fire.o sql_lite.o sql_my.o sql_oci.o sql_odbc.o \
   66                    sql_post.o sql_srv.o sql_tds.o
   67 COMP_DATA_LIB_OBJ = typ_data.o rfl_data.o ref_data.o listutl.o flistutl.o typeutl.o datautl.o
   68 COMPILER_LIB_OBJ = $(POBJ) $(LOBJ) $(EOBJ) $(AOBJ) $(GOBJ)
   69 
   70 MSRC = s7.c
   71 PSRC = runerr.c option.c primitiv.c
   72 LSRC = actlib.c arrlib.c biglib.c binlib.c blnlib.c bstlib.c chrlib.c cmdlib.c conlib.c dcllib.c \
   73        drwlib.c enulib.c fillib.c fltlib.c hshlib.c intlib.c itflib.c kbdlib.c lstlib.c pcslib.c \
   74        pollib.c prclib.c prglib.c reflib.c rfllib.c sctlib.c setlib.c soclib.c sqllib.c strlib.c \
   75        timlib.c typlib.c ut8lib.c
   76 ESRC = exec.c doany.c objutl.c
   77 ASRC = act_comp.c prg_comp.c analyze.c syntax.c token.c parser.c name.c type.c \
   78        expr.c atom.c object.c scanner.c literal.c numlit.c findid.c \
   79        error.c infile.c libpath.c symbol.c info.c stat.c fatal.c match.c
   80 GSRC = syvarutl.c traceutl.c actutl.c executl.c blockutl.c \
   81        entutl.c identutl.c chclsutl.c arrutl.c
   82 RSRC = arr_rtl.c bln_rtl.c bst_rtl.c chr_rtl.c cmd_rtl.c con_rtl.c dir_rtl.c drw_rtl.c fil_rtl.c \
   83        flt_rtl.c hsh_rtl.c int_rtl.c itf_rtl.c pcs_rtl.c set_rtl.c soc_rtl.c sql_rtl.c str_rtl.c \
   84        tim_rtl.c ut8_rtl.c heaputl.c numutl.c sigutl.c striutl.c
   85 DSRC = big_rtl.c big_gmp.c cmd_unx.c dir_win.c dll_unx.c fil_unx.c pcs_unx.c pol_unx.c soc_none.c \
   86        tim_unx.c
   87 SRC = $(MSRC)
   88 SEED7_LIB_SRC = $(RSRC) $(DSRC)
   89 DRAW_LIB_SRC = gkb_rtl.c drw_x11.c gkb_x11.c fwd_x11.c
   90 CONSOLE_LIB_SRC = kbd_rtl.c con_inf.c kbd_inf.c kbd_poll.c trm_inf.c trm_cap.c fwd_term.c
   91 DATABASE_LIB_SRC_STD_INCL = sql_base.c sql_fire.c sql_lite.c sql_my.c sql_oci.c sql_odbc.c \
   92                             sql_post.c sql_tds.c
   93 DATABASE_LIB_SRC = $(DATABASE_LIB_SRC_STD_INCL) sql_db2.c sql_srv.c
   94 COMP_DATA_LIB_SRC = typ_data.c rfl_data.c ref_data.c listutl.c flistutl.c typeutl.c datautl.c
   95 COMPILER_LIB_SRC = $(PSRC) $(LSRC) $(ESRC) $(ASRC) $(GSRC)
   96 
   97 s7: ../bin/s7 ../prg/s7
   98     ../bin/s7 -l ../lib level
   99     @echo
  100     @echo "  Use 'make s7c' (with your make command) to create the compiler."
  101     @echo
  102 
  103 s7c: ../bin/s7c ../prg/s7c
  104     @echo
  105     @echo "  Use 'make test' (with your make command) to check Seed7."
  106     @echo
  107 
  108 ../bin/s7: levelup next_lvl $(OBJ) $(ALL_S7_LIBS)
  109     $(CC) $(LDFLAGS) $(OBJ) $(ALL_S7_LIBS) $(SYSTEM_DRAW_LIBS) $(SYSTEM_CONSOLE_LIBS) $(SYSTEM_DATABASE_LIBS) $(SYSTEM_LIBS) $(ADDITIONAL_SYSTEM_LIBS) -o ../bin/s7
  110     rm next_lvl
  111 
  112 ../prg/s7:
  113     ln -s ../bin/s7 ../prg
  114 
  115 ../bin/s7c: ../prg/s7c
  116     cp -p ../prg/s7c ../bin
  117 
  118 ../prg/s7c: ../prg/s7c.sd7 $(ALL_S7_LIBS)
  119     ../bin/s7 -l ../lib ../prg/s7c -l ../lib -b ../bin -O2 ../prg/s7c
  120 
  121 levelup: levelup.c
  122     $(CC) levelup.c -o levelup
  123 
  124 next_lvl: levelup
  125     ./levelup
  126     echo "X" > next_lvl
  127 
  128 OBJCOPY_PARAMS = \
  129        -L SQLAllocHandle -L SQLBindCol -L SQLBindParameter -L SQLBrowseConnectW -L SQLColAttributeW \
  130        -L SQLConnectW -L SQLDataSources -L SQLDescribeColW -L SQLDescribeParam -L SQLDisconnect \
  131        -L SQLDriverConnectW -L SQLDriversW -L SQLExecute -L SQLFetch -L SQLFreeHandle \
  132        -L SQLFreeStmt -L SQLGetData -L SQLGetDiagRecW -L SQLGetInfoW -L SQLGetStmtAttrW \
  133        -L SQLGetTypeInfoW -L SQLNumParams -L SQLNumResultCols -L SQLPrepareW -L SQLSetDescFieldW \
  134        -L SQLSetEnvAttr
  135 
  136 sql_db2.o: sql_db2.c
  137     $(CC) $(CPPFLAGS) $(DB2_INCLUDE_OPTION) $(CFLAGS) $(DB2_LIBS) -c -r -o $@ $<
  138     objcopy $(OBJCOPY_PARAMS) $@
  139 
  140 sql_srv.o: sql_srv.c
  141     $(CC) $(CPPFLAGS) $(SQL_SERVER_INCLUDE_OPTION) $(CFLAGS) $(SQL_SERVER_LIBS) -c -r -o $@ $<
  142     objcopy $(OBJCOPY_PARAMS) $@
  143 
  144 all: depend
  145     $(MAKE) -f mk_icc.mak s7 s7c
  146 
  147 clear: clean
  148 
  149 clean:
  150     rm -f *.o ../bin/*.a ../bin/s7 ../bin/s7c ../prg/s7 ../prg/s7c depend macros chkccomp.h base.h settings.h version.h wrdepend levelup next_lvl
  151     @echo
  152     @echo "  Use 'make depend' (with your make command) to create the dependencies."
  153     @echo
  154 
  155 distclean: clean
  156     cp level_bk.h level.h
  157     rm -f vers_icc.h
  158 
  159 test:
  160     ../bin/s7 -l ../lib ../prg/chk_all build
  161     @echo
  162     @echo "  Use 'sudo make install' (with your make command) to install Seed7."
  163     @echo
  164 
  165 install:
  166     cd ../bin; ln -s `pwd`/s7 /usr/local/bin
  167     cd ../bin; ln -s `pwd`/s7c /usr/local/bin
  168     gzip -c ../doc/s7.1 > /usr/share/man/man1/s7.1.gz
  169     gzip -c ../doc/s7c.1 > /usr/share/man/man1/s7c.1.gz
  170 
  171 uninstall:
  172     rm /usr/local/bin/s7
  173     rm /usr/local/bin/s7c
  174     rm /usr/share/man/man1/s7.1.gz
  175     rm /usr/share/man/man1/s7c.1.gz
  176 
  177 dep: depend
  178 
  179 strip:
  180     strip ../bin/s7
  181 
  182 chkccomp.h:
  183     echo "#define LIST_DIRECTORY_CONTENTS \"ls\"" > chkccomp.h
  184     echo "#define SUPPORTS_PARTIAL_LINKING" >> chkccomp.h
  185 
  186 base.h:
  187     echo "#define PATH_DELIMITER '/'" > base.h
  188     echo "#define OBJECT_FILE_EXTENSION \".o\"" >> base.h
  189     echo "#define C_COMPILER \"$(CC)\"" >> base.h
  190     echo "#define CC_OPT_VERSION_INFO \"--version\"" >> base.h
  191     echo "#define CC_FLAGS \"-ffunction-sections -fdata-sections -fp-model precise -fp-model source -mp1\"" >> base.h
  192     echo "#define CC_ERROR_FILEDES 2" >> base.h
  193     echo "#define CC_VERSION_INFO_FILEDES 1" >> base.h
  194     echo "#define LINKER_OPT_OUTPUT_FILE \"-o \"" >> base.h
  195     echo "#define SYSTEM_LIBS \"$(SYSTEM_LIBS)\"" >> base.h
  196 
  197 settings.h:
  198     echo "#define MAKE_UTILITY_NAME \"$(MAKE)\"" > settings.h
  199     echo "#define MAKEFILE_NAME \"mk_icc.mak\"" >> settings.h
  200     echo "#define SEARCH_PATH_DELIMITER ':'" >> settings.h
  201     echo "#define AWAIT_WITH_SELECT" >> settings.h
  202     echo "#define SIGNAL_HANDLER_CAN_DO_IO" >> settings.h
  203     echo "#define CONSOLE_UTF8" >> settings.h
  204     echo "#define OS_STRI_UTF8" >> settings.h
  205     echo "#define ESCAPE_SHELL_COMMANDS" >> settings.h
  206     echo "#define LIBRARY_FILE_EXTENSION \".a\"" >> settings.h
  207     echo "#define CPLUSPLUS_COMPILER \"icpc\"" >> settings.h
  208     echo "#define CC_SOURCE_UTF8" >> settings.h
  209     echo "#define CC_OPT_DEBUG_INFO \"-g\"" >> settings.h
  210     echo "#define CC_OPT_NO_WARNINGS \"-w\"" >> settings.h
  211     echo "#define LINKER_OPT_NO_DEBUG_INFO \"-Wl,--strip-debug\"" >> settings.h
  212     echo "#define LINKER_FLAGS \"$(LDFLAGS)\"" >> settings.h
  213     echo "#define SEED7_LIB \"$(SEED7_LIB)\"" >> settings.h
  214     echo "#define DRAW_LIB \"$(DRAW_LIB)\"" >> settings.h
  215     echo "#define CONSOLE_LIB \"$(CONSOLE_LIB)\"" >> settings.h
  216     echo "#define DATABASE_LIB \"$(DATABASE_LIB)\"" >> settings.h
  217     echo "#define COMP_DATA_LIB \"$(COMP_DATA_LIB)\"" >> settings.h
  218     echo "#define COMPILER_LIB \"$(COMPILER_LIB)\"" >> settings.h
  219 
  220 version.h: chkccomp.h base.h settings.h
  221     $(CC) chkccomp.c -o chkccomp
  222     ./chkccomp version.h
  223     rm chkccomp
  224     $(CC) setpaths.c -o setpaths
  225     ./setpaths "S7_LIB_DIR=$(S7_LIB_DIR)" "SEED7_LIBRARY=$(SEED7_LIBRARY)" >> version.h
  226     rm setpaths
  227     $(CC) wrdepend.c -o wrdepend
  228     cp version.h vers_icc.h
  229 
  230 depend: version.h
  231     ./wrdepend OPTION=INCLUDE_OPTIONS $(CFLAGS) -M $(SRC) "> depend"
  232     ./wrdepend OPTION=INCLUDE_OPTIONS $(CFLAGS) -M $(SEED7_LIB_SRC) ">> depend"
  233     ./wrdepend OPTION=INCLUDE_OPTIONS $(CFLAGS) -M $(DRAW_LIB_SRC) ">> depend"
  234     ./wrdepend OPTION=INCLUDE_OPTIONS $(CFLAGS) -M $(CONSOLE_LIB_SRC) ">> depend"
  235     ./wrdepend OPTION=INCLUDE_OPTIONS $(CFLAGS) -M $(DATABASE_LIB_SRC_STD_INCL) ">> depend"
  236     ./wrdepend OPTION=DB2_INCLUDE_OPTION $(CFLAGS) -M sql_db2.c ">> depend"
  237     ./wrdepend OPTION=SQL_SERVER_INCLUDE_OPTION $(CFLAGS) -M sql_srv.c ">> depend"
  238     ./wrdepend OPTION=INCLUDE_OPTIONS $(CFLAGS) -M $(COMP_DATA_LIB_SRC) ">> depend"
  239     ./wrdepend OPTION=INCLUDE_OPTIONS $(CFLAGS) -M $(COMPILER_LIB_SRC) ">> depend"
  240     $(CC) warn.c -o warn
  241     @./warn
  242     @rm warn
  243     @echo
  244     @echo "  Use 'make' (with your make command) to create the interpreter."
  245     @echo
  246 
  247 ../bin/$(SEED7_LIB): $(SEED7_LIB_OBJ)
  248     $(AR) r ../bin/$(SEED7_LIB) $(SEED7_LIB_OBJ)
  249 
  250 ../bin/$(DRAW_LIB): $(DRAW_LIB_OBJ)
  251     $(AR) r ../bin/$(DRAW_LIB) $(DRAW_LIB_OBJ)
  252 
  253 ../bin/$(CONSOLE_LIB): $(CONSOLE_LIB_OBJ)
  254     $(AR) r ../bin/$(CONSOLE_LIB) $(CONSOLE_LIB_OBJ)
  255 
  256 ../bin/$(DATABASE_LIB): $(DATABASE_LIB_OBJ)
  257     $(AR) r ../bin/$(DATABASE_LIB) $(DATABASE_LIB_OBJ)
  258 
  259 ../bin/$(COMP_DATA_LIB): $(COMP_DATA_LIB_OBJ)
  260     $(AR) r ../bin/$(COMP_DATA_LIB) $(COMP_DATA_LIB_OBJ)
  261 
  262 ../bin/$(COMPILER_LIB): $(COMPILER_LIB_OBJ)
  263     $(AR) r ../bin/$(COMPILER_LIB) $(COMPILER_LIB_OBJ)
  264 
  265 ../bin/%: ../prg/%.sd7 ../bin/s7c
  266     ../bin/s7c -l ../lib -b ../bin -O2 $<
  267     mv $(<:.sd7=) ../bin
  268 
  269 bas7: ../bin/bas7
  270 bigfiles: ../bin/bigfiles
  271 calc7: ../bin/calc7
  272 cat: ../bin/cat
  273 comanche: ../bin/comanche
  274 db7: ../bin/db7
  275 diff7: ../bin/diff7
  276 find7: ../bin/find7
  277 findchar: ../bin/findchar
  278 ftp7: ../bin/ftp7
  279 ftpserv: ../bin/ftpserv
  280 hd: ../bin/hd
  281 make7: ../bin/make7
  282 sql7: ../bin/sql7
  283 sydir7: ../bin/sydir7
  284 tar7: ../bin/tar7
  285 toutf8: ../bin/toutf8
  286 which: ../bin/which
  287 
  288 utils: ../bin/bas7 ../bin/bigfiles ../bin/calc7 ../bin/cat ../bin/comanche ../bin/db7 \
  289        ../bin/diff7 ../bin/find7 ../bin/findchar ../bin/ftp7 ../bin/ftpserv ../bin/hd \
  290        ../bin/make7 ../bin/sql7 ../bin/sydir7 ../bin/tar7 ../bin/toutf8 ../bin/which
  291 
  292 wc: $(SRC)
  293     @echo SRC:
  294     wc $(SRC)
  295     @echo SEED7_LIB_SRC:
  296     wc $(SEED7_LIB_SRC)
  297     @echo DRAW_LIB_SRC:
  298     wc $(DRAW_LIB_SRC)
  299     @echo CONSOLE_LIB_SRC:
  300     wc $(CONSOLE_LIB_SRC)
  301     @echo DATABASE_LIB_SRC:
  302     wc $(DATABASE_LIB_SRC)
  303     @echo COMP_DATA_LIB_SRC:
  304     wc $(COMP_DATA_LIB_SRC)
  305     @echo COMPILER_LIB_SRC:
  306     wc $(COMPILER_LIB_SRC)
  307 
  308 lint: $(SRC)
  309     lint -p $(SRC) $(SYSTEM_DRAW_LIBS) $(SYSTEM_CONSOLE_LIBS) $(SYSTEM_DATABASE_LIBS) $(SYSTEM_LIBS) $(ADDITIONAL_SYSTEM_LIBS)
  310 
  311 lint2: $(SRC)
  312     lint -Zn2048 $(SRC) $(SYSTEM_DRAW_LIBS) $(SYSTEM_CONSOLE_LIBS) $(SYSTEM_DATABASE_LIBS) $(SYSTEM_LIBS) $(ADDITIONAL_SYSTEM_LIBS)
  313 
  314 cppcheck: $(SRC) $(SEED7_LIB_SRC) $(DRAW_LIB_SRC) $(COMP_DATA_LIB_SRC) $(COMPILER_LIB_SRC)
  315     cppcheck --force --enable=all $(SRC) $(SEED7_LIB_SRC) $(DRAW_LIB_SRC) $(COMP_DATA_LIB_SRC) $(COMPILER_LIB_SRC)
  316 
  317 ifeq (depend,$(wildcard depend))
  318 include depend
  319 endif
  320 
  321 ifeq (macros,$(wildcard macros))
  322 include macros
  323 endif