"Fossies" - the Fresh Open Source Software Archive

Member "seed7/src/mk_osxcl.mak" (10 Feb 2021, 13393 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_osxcl.mak": 05_20210130_vs_05_20210223.

    1 # Makefile for Mac OS X with clang from Xcode. Commands executed by: bash
    2 # To compile use a command shell and call:
    3 #   make -f mk_osxcl.mak depend
    4 #   make -f mk_osxcl.mak
    5 # If you are not using Mac OS X with Xcode look into the file read_me.txt for the makefile to use.
    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++ $(INCLUDE_OPTIONS) -Wall -Winline -Wconversion -Wshadow -Wpointer-arith
   15 # CFLAGS = -O2 -g $(INCLUDE_OPTIONS) -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith
   16 CFLAGS = -O2 -g -ffunction-sections -fdata-sections $(INCLUDE_OPTIONS) $(CC_OPT_LINK_TIME_OPTIMIZATION) -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -ftrapv
   17 # CFLAGS = -O2 -g -ffunction-sections -fdata-sections $(INCLUDE_OPTIONS) -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -ftrapv -fsanitize=address,integer,undefined -fno-sanitize=unsigned-integer-overflow
   18 # CFLAGS = -O2 -g -std=c99 -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 =
   25 # LDFLAGS = -Wl,-L/usr/X11R6/lib
   26 # LDFLAGS = -Wl,-L/usr/X11R6/lib -fsanitize=address,integer,undefined -fno-sanitize=unsigned-integer-overflow
   27 # LDFLAGS = -pg
   28 # LDFLAGS = -pg -lc_p
   29 SYSTEM_LIBS = -lm -ldl
   30 # SYSTEM_LIBS = -lm -ldl -lgmp
   31 # SYSTEM_LIBS = -lm_p -lc_p
   32 # SYSTEM_DRAW_LIBS is defined in the file "macros". The program chkccomp.c writes it to "macros" when doing "make depend".
   33 # SYSTEM_CONSOLE_LIBS is defined in the file "macros". The program chkccomp.c writes it to "macros" when doing "make depend".
   34 # SYSTEM_DATABASE_LIBS is defined in the file "macros". The program chkccomp.c writes it to "macros" when doing "make depend".
   35 SEED7_LIB = seed7_05.a
   36 DRAW_LIB = s7_draw.a
   37 CONSOLE_LIB = s7_con.a
   38 DATABASE_LIB = s7_db.a
   39 COMP_DATA_LIB = s7_data.a
   40 COMPILER_LIB = s7_comp.a
   41 ALL_S7_LIBS = ../bin/$(COMPILER_LIB) ../bin/$(COMP_DATA_LIB) ../bin/$(DRAW_LIB) ../bin/$(CONSOLE_LIB) ../bin/$(DATABASE_LIB) ../bin/$(SEED7_LIB)
   42 # CC = clang++
   43 CC = clang
   44 AR = ar
   45 
   46 MOBJ = s7.o
   47 POBJ = runerr.o option.o primitiv.o
   48 LOBJ = actlib.o arrlib.o biglib.o binlib.o blnlib.o bstlib.o chrlib.o cmdlib.o conlib.o dcllib.o \
   49        drwlib.o enulib.o fillib.o fltlib.o hshlib.o intlib.o itflib.o kbdlib.o lstlib.o pcslib.o \
   50        pollib.o prclib.o prglib.o reflib.o rfllib.o sctlib.o setlib.o soclib.o sqllib.o strlib.o \
   51        timlib.o typlib.o ut8lib.o
   52 EOBJ = exec.o doany.o objutl.o
   53 AOBJ = act_comp.o prg_comp.o analyze.o syntax.o token.o parser.o name.o type.o \
   54        expr.o atom.o object.o scanner.o literal.o numlit.o findid.o \
   55        error.o infile.o libpath.o symbol.o info.o stat.o fatal.o match.o
   56 GOBJ = syvarutl.o traceutl.o actutl.o executl.o blockutl.o \
   57        entutl.o identutl.o chclsutl.o arrutl.o
   58 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 \
   59        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 \
   60        tim_rtl.o ut8_rtl.o heaputl.o numutl.o sigutl.o striutl.o
   61 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 \
   62        tim_unx.o
   63 OBJ = $(MOBJ)
   64 SEED7_LIB_OBJ = $(ROBJ) $(DOBJ)
   65 DRAW_LIB_OBJ = gkb_rtl.o drw_x11.o gkb_x11.o fwd_x11.o
   66 CONSOLE_LIB_OBJ = kbd_rtl.o con_inf.o kbd_inf.o kbd_poll.o trm_inf.o trm_cap.o fwd_term.o
   67 DATABASE_LIB_OBJ = sql_base.o sql_db2.o sql_fire.o sql_lite.o sql_my.o sql_oci.o sql_odbc.o \
   68                    sql_post.o sql_srv.o sql_tds.o
   69 COMP_DATA_LIB_OBJ = typ_data.o rfl_data.o ref_data.o listutl.o flistutl.o typeutl.o datautl.o
   70 COMPILER_LIB_OBJ = $(POBJ) $(LOBJ) $(EOBJ) $(AOBJ) $(GOBJ)
   71 
   72 MSRC = s7.c
   73 PSRC = runerr.c option.c primitiv.c
   74 LSRC = actlib.c arrlib.c biglib.c binlib.c blnlib.c bstlib.c chrlib.c cmdlib.c conlib.c dcllib.c \
   75        drwlib.c enulib.c fillib.c fltlib.c hshlib.c intlib.c itflib.c kbdlib.c lstlib.c pcslib.c \
   76        pollib.c prclib.c prglib.c reflib.c rfllib.c sctlib.c setlib.c soclib.c sqllib.c strlib.c \
   77        timlib.c typlib.c ut8lib.c
   78 ESRC = exec.c doany.c objutl.c
   79 ASRC = act_comp.c prg_comp.c analyze.c syntax.c token.c parser.c name.c type.c \
   80        expr.c atom.c object.c scanner.c literal.c numlit.c findid.c \
   81        error.c infile.c libpath.c symbol.c info.c stat.c fatal.c match.c
   82 GSRC = syvarutl.c traceutl.c actutl.c executl.c blockutl.c \
   83        entutl.c identutl.c chclsutl.c arrutl.c
   84 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 \
   85        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 \
   86        tim_rtl.c ut8_rtl.c heaputl.c numutl.c sigutl.c striutl.c
   87 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 \
   88        tim_unx.c
   89 SRC = $(MSRC)
   90 SEED7_LIB_SRC = $(RSRC) $(DSRC)
   91 DRAW_LIB_SRC = gkb_rtl.c drw_x11.c gkb_x11.c fwd_x11.c
   92 CONSOLE_LIB_SRC = kbd_rtl.c con_inf.c kbd_inf.c kbd_poll.c trm_inf.c trm_cap.c fwd_term.c
   93 DATABASE_LIB_SRC_STD_INCL = sql_base.c sql_fire.c sql_lite.c sql_my.c sql_oci.c sql_odbc.c \
   94                             sql_post.c sql_tds.c
   95 DATABASE_LIB_SRC = $(DATABASE_LIB_SRC_STD_INCL) sql_db2.c sql_srv.c
   96 COMP_DATA_LIB_SRC = typ_data.c rfl_data.c ref_data.c listutl.c flistutl.c typeutl.c datautl.c
   97 COMPILER_LIB_SRC = $(PSRC) $(LSRC) $(ESRC) $(ASRC) $(GSRC)
   98 
   99 s7: ../bin/s7 ../prg/s7
  100     ../bin/s7 -l ../lib level
  101     @echo
  102     @echo "  Use 'make s7c' (with your make command) to create the compiler."
  103     @echo
  104 
  105 s7c: ../bin/s7c ../prg/s7c
  106     @echo
  107     @echo "  Use 'make test' (with your make command) to check Seed7."
  108     @echo
  109 
  110 ../bin/s7: levelup next_lvl $(OBJ) $(ALL_S7_LIBS)
  111     $(CC) $(LDFLAGS) $(OBJ) $(ALL_S7_LIBS) $(SYSTEM_DRAW_LIBS) $(SYSTEM_CONSOLE_LIBS) $(SYSTEM_DATABASE_LIBS) $(SYSTEM_LIBS) $(ADDITIONAL_SYSTEM_LIBS) -o ../bin/s7
  112     rm next_lvl
  113 
  114 ../prg/s7:
  115     ln -s ../bin/s7 ../prg
  116 
  117 ../bin/s7c: ../prg/s7c
  118     cp -p ../prg/s7c ../bin
  119 
  120 ../prg/s7c: ../prg/s7c.sd7 $(ALL_S7_LIBS)
  121     ../bin/s7 -l ../lib ../prg/s7c -l ../lib -b ../bin -O2 ../prg/s7c
  122 
  123 levelup: levelup.c
  124     $(CC) levelup.c -o levelup
  125 
  126 next_lvl: levelup
  127     ./levelup
  128     echo "X" > next_lvl
  129 
  130 sql_db2.o: sql_db2.c
  131     $(CC) -c $(CPPFLAGS) $(DB2_INCLUDE_OPTION) $(CFLAGS) $< -o $@
  132 
  133 sql_srv.o: sql_srv.c
  134     $(CC) -c $(CPPFLAGS) $(SQL_SERVER_INCLUDE_OPTION) $(CFLAGS) $< -o $@
  135 
  136 all: depend
  137     $(MAKE) -f mk_osxcl.mak s7 s7c
  138 
  139 clear: clean
  140 
  141 clean:
  142     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
  143     @echo
  144     @echo "  Use 'make depend' (with your make command) to create the dependencies."
  145     @echo
  146 
  147 distclean: clean
  148     cp level_bk.h level.h
  149     rm -f vers_osxcl.h
  150 
  151 test:
  152     ../bin/s7 -l ../lib ../prg/chk_all build
  153     @echo
  154     @echo "  Use 'sudo make install' (with your make command) to install Seed7."
  155     @echo
  156 
  157 install:
  158     mkdir -p /usr/local/bin
  159     cd ../bin; ln -s `pwd`/s7 /usr/local/bin
  160     cd ../bin; ln -s `pwd`/s7c /usr/local/bin
  161     gzip -c ../doc/s7.1 > /usr/share/man/man1/s7.1.gz
  162     gzip -c ../doc/s7c.1 > /usr/share/man/man1/s7c.1.gz
  163 
  164 uninstall:
  165     rm /usr/local/bin/s7
  166     rm /usr/local/bin/s7c
  167     rm /usr/share/man/man1/s7.1.gz
  168     rm /usr/share/man/man1/s7c.1.gz
  169 
  170 dep: depend
  171 
  172 strip:
  173     strip ../bin/s7
  174 
  175 chkccomp.h:
  176     echo "#define LIST_DIRECTORY_CONTENTS \"ls\"" > chkccomp.h
  177     echo "#define CC_OPT_LINK_TIME_OPTIMIZATION \"-flto\"" >> chkccomp.h
  178     echo "#define X11_LIBRARY_PATH \"/usr/X11R6/lib\"" >> chkccomp.h
  179 
  180 base.h:
  181     echo "#define PATH_DELIMITER '/'" > base.h
  182     echo "#define OBJECT_FILE_EXTENSION \".o\"" >> base.h
  183     echo "#define C_COMPILER \"$(CC)\"" >> base.h
  184     echo "#define CC_OPT_TRAP_OVERFLOW \"-ftrapv\"" >> base.h
  185     echo "#define CC_OPT_VERSION_INFO \"--version\"" >> base.h
  186     echo "#define CC_FLAGS \"-ffunction-sections -fdata-sections\"" >> base.h
  187     echo "#define CC_ERROR_FILEDES 2" >> base.h
  188     echo "#define CC_VERSION_INFO_FILEDES 1" >> base.h
  189     echo "#define LINKER_OPT_OUTPUT_FILE \"-o \"" >> base.h
  190     echo "#define ARCHIVER \"$(AR)\"" >> base.h
  191     echo "#define ARCHIVER_OPT_REPLACE \"r \"" >> base.h
  192     echo "#define SYSTEM_LIBS \"$(SYSTEM_LIBS)\"" >> base.h
  193 
  194 settings.h:
  195     echo "#define MAKE_UTILITY_NAME \"$(MAKE)\"" > settings.h
  196     echo "#define MAKEFILE_NAME \"mk_osxcl.mak\"" >> settings.h
  197     echo "#define SEARCH_PATH_DELIMITER ':'" >> settings.h
  198     echo "#define AWAIT_WITH_SELECT" >> settings.h
  199     echo "#define SIGNAL_HANDLER_CAN_DO_IO" >> settings.h
  200     echo "#define CONSOLE_UTF8" >> settings.h
  201     echo "#define OS_STRI_UTF8" >> settings.h
  202     echo "#define ESCAPE_SHELL_COMMANDS" >> settings.h
  203     echo "#define LIBRARY_FILE_EXTENSION \".a\"" >> settings.h
  204     echo "#define CPLUSPLUS_COMPILER \"$(CC) -x c++\"" >> settings.h
  205     echo "#define CC_SOURCE_UTF8" >> settings.h
  206     echo "#define CC_OPT_DEBUG_INFO \"-g\"" >> settings.h
  207     echo "#define CC_OPT_NO_WARNINGS \"-w\"" >> settings.h
  208     echo "#define LINKER_FLAGS \"$(LDFLAGS)\"" >> settings.h
  209     echo "#define SEED7_LIB \"$(SEED7_LIB)\"" >> settings.h
  210     echo "#define DRAW_LIB \"$(DRAW_LIB)\"" >> settings.h
  211     echo "#define CONSOLE_LIB \"$(CONSOLE_LIB)\"" >> settings.h
  212     echo "#define DATABASE_LIB \"$(DATABASE_LIB)\"" >> settings.h
  213     echo "#define COMP_DATA_LIB \"$(COMP_DATA_LIB)\"" >> settings.h
  214     echo "#define COMPILER_LIB \"$(COMPILER_LIB)\"" >> settings.h
  215 
  216 version.h: chkccomp.h base.h settings.h
  217     $(CC) -ftrapv chkccomp.c -o chkccomp
  218     ./chkccomp version.h
  219     rm chkccomp
  220     $(CC) setpaths.c -o setpaths
  221     ./setpaths "S7_LIB_DIR=$(S7_LIB_DIR)" "SEED7_LIBRARY=$(SEED7_LIBRARY)" >> version.h
  222     rm setpaths
  223     $(CC) wrdepend.c -o wrdepend
  224     cp version.h vers_osxcl.h
  225 
  226 depend: version.h
  227     ./wrdepend OPTION=INCLUDE_OPTIONS $(CFLAGS) -M $(SRC) "> depend"
  228     ./wrdepend OPTION=INCLUDE_OPTIONS $(CFLAGS) -M $(SEED7_LIB_SRC) ">> depend"
  229     ./wrdepend OPTION=INCLUDE_OPTIONS $(CFLAGS) -M $(DRAW_LIB_SRC) ">> depend"
  230     ./wrdepend OPTION=INCLUDE_OPTIONS $(CFLAGS) -M $(CONSOLE_LIB_SRC) ">> depend"
  231     ./wrdepend OPTION=INCLUDE_OPTIONS $(CFLAGS) -M $(DATABASE_LIB_SRC_STD_INCL) ">> depend"
  232     ./wrdepend OPTION=DB2_INCLUDE_OPTION $(CFLAGS) -M sql_db2.c ">> depend"
  233     ./wrdepend OPTION=SQL_SERVER_INCLUDE_OPTION $(CFLAGS) -M sql_srv.c ">> depend"
  234     ./wrdepend OPTION=INCLUDE_OPTIONS $(CFLAGS) -M $(COMP_DATA_LIB_SRC) ">> depend"
  235     ./wrdepend OPTION=INCLUDE_OPTIONS $(CFLAGS) -M $(COMPILER_LIB_SRC) ">> depend"
  236     @echo
  237     @echo "  Use 'make' (with your make command) to create the interpreter."
  238     @echo
  239 
  240 ../bin/$(SEED7_LIB): $(SEED7_LIB_OBJ)
  241     $(AR) r ../bin/$(SEED7_LIB) $(SEED7_LIB_OBJ)
  242 
  243 ../bin/$(DRAW_LIB): $(DRAW_LIB_OBJ)
  244     $(AR) r ../bin/$(DRAW_LIB) $(DRAW_LIB_OBJ)
  245 
  246 ../bin/$(CONSOLE_LIB): $(CONSOLE_LIB_OBJ)
  247     $(AR) r ../bin/$(CONSOLE_LIB) $(CONSOLE_LIB_OBJ)
  248 
  249 ../bin/$(DATABASE_LIB): $(DATABASE_LIB_OBJ)
  250     $(AR) r ../bin/$(DATABASE_LIB) $(DATABASE_LIB_OBJ)
  251 
  252 ../bin/$(COMP_DATA_LIB): $(COMP_DATA_LIB_OBJ)
  253     $(AR) r ../bin/$(COMP_DATA_LIB) $(COMP_DATA_LIB_OBJ)
  254 
  255 ../bin/$(COMPILER_LIB): $(COMPILER_LIB_OBJ)
  256     $(AR) r ../bin/$(COMPILER_LIB) $(COMPILER_LIB_OBJ)
  257 
  258 ../bin/%: ../prg/%.sd7 ../bin/s7c
  259     ../bin/s7c -l ../lib -b ../bin -O2 $<
  260     mv $(<:.sd7=) ../bin
  261 
  262 bas7: ../bin/bas7
  263 bigfiles: ../bin/bigfiles
  264 calc7: ../bin/calc7
  265 cat: ../bin/cat
  266 comanche: ../bin/comanche
  267 db7: ../bin/db7
  268 diff7: ../bin/diff7
  269 find7: ../bin/find7
  270 findchar: ../bin/findchar
  271 ftp7: ../bin/ftp7
  272 ftpserv: ../bin/ftpserv
  273 hd: ../bin/hd
  274 make7: ../bin/make7
  275 sql7: ../bin/sql7
  276 sydir7: ../bin/sydir7
  277 tar7: ../bin/tar7
  278 toutf8: ../bin/toutf8
  279 which: ../bin/which
  280 
  281 utils: ../bin/bas7 ../bin/bigfiles ../bin/calc7 ../bin/cat ../bin/comanche ../bin/db7 \
  282        ../bin/diff7 ../bin/find7 ../bin/findchar ../bin/ftp7 ../bin/ftpserv ../bin/hd \
  283        ../bin/make7 ../bin/sql7 ../bin/sydir7 ../bin/tar7 ../bin/toutf8 ../bin/which
  284 
  285 wc: $(SRC)
  286     @echo SRC:
  287     wc $(SRC)
  288     @echo SEED7_LIB_SRC:
  289     wc $(SEED7_LIB_SRC)
  290     @echo DRAW_LIB_SRC:
  291     wc $(DRAW_LIB_SRC)
  292     @echo CONSOLE_LIB_SRC:
  293     wc $(CONSOLE_LIB_SRC)
  294     @echo DATABASE_LIB_SRC:
  295     wc $(DATABASE_LIB_SRC)
  296     @echo COMP_DATA_LIB_SRC:
  297     wc $(COMP_DATA_LIB_SRC)
  298     @echo COMPILER_LIB_SRC:
  299     wc $(COMPILER_LIB_SRC)
  300 
  301 lint: $(SRC)
  302     lint -p $(SRC) $(SYSTEM_DRAW_LIBS) $(SYSTEM_CONSOLE_LIBS) $(SYSTEM_DATABASE_LIBS) $(SYSTEM_LIBS) $(ADDITIONAL_SYSTEM_LIBS)
  303 
  304 lint2: $(SRC)
  305     lint -Zn2048 $(SRC) $(SYSTEM_DRAW_LIBS) $(SYSTEM_CONSOLE_LIBS) $(SYSTEM_DATABASE_LIBS) $(SYSTEM_LIBS) $(ADDITIONAL_SYSTEM_LIBS)
  306 
  307 ifeq (depend,$(wildcard depend))
  308 include depend
  309 endif
  310 
  311 ifeq (macros,$(wildcard macros))
  312 include macros
  313 endif