1 # Makefile for mingw32-make and tcc. Commands executed by: cmd.exe 2 # To compile use a Windows console and call: 3 # mingw32-make -f mk_tcc_w.mak depend 4 # mingw32-make -f mk_tcc_w.mak 5 # If you are using tcc under linux/unix/bsd you should use mk_tcc_l.mak instead. 6 7 # CFLAGS = -O2 -fomit-frame-pointer -funroll-loops -Wall 8 # CFLAGS = -O2 -fomit-frame-pointer -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith 9 CFLAGS = -g $(INCLUDE_OPTIONS) -Wall -Wimplicit-function-declaration -Wunusupported -Wwrite-strings 10 # CFLAGS = -O2 -g -pg -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith 11 # CFLAGS = -O2 -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith 12 # CFLAGS = -O2 -pg -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith 13 # CFLAGS = -O2 -funroll-loops -Wall -pg 14 LDFLAGS = -Wl,-stack=16777216 15 # LDFLAGS = -pg 16 # LDFLAGS = -pg -lc_p 17 SYSTEM_LIBS = -lws2_32 -ladvapi32 18 # SYSTEM_LIBS = -lgmp 19 SYSTEM_DRAW_LIBS = -lgdi32 -luser32 20 SYSTEM_CONSOLE_LIBS = 21 # SYSTEM_DATABASE_LIBS is defined in the file "macros". The program chkccomp.c writes it to "macros" when doing "make depend". 22 SEED7_LIB = seed7_05.a 23 DRAW_LIB = s7_draw.a 24 CONSOLE_LIB = s7_con.a 25 DATABASE_LIB = s7_db.a 26 COMP_DATA_LIB = s7_data.a 27 COMPILER_LIB = s7_comp.a 28 ALL_S7_LIBS = ..\bin\$(COMPILER_LIB) ..\bin\$(COMP_DATA_LIB) ..\bin\$(DRAW_LIB) ..\bin\$(CONSOLE_LIB) ..\bin\$(DATABASE_LIB) ..\bin\$(SEED7_LIB) 29 CC = tcc 30 AR = ar -r 31 # AR = tiny_libmaker 32 33 MOBJ = s7.o 34 POBJ = runerr.o option.o primitiv.o 35 LOBJ = actlib.o arrlib.o biglib.o binlib.o blnlib.o bstlib.o chrlib.o cmdlib.o conlib.o dcllib.o \ 36 drwlib.o enulib.o fillib.o fltlib.o hshlib.o intlib.o itflib.o kbdlib.o lstlib.o pcslib.o \ 37 pollib.o prclib.o prglib.o reflib.o rfllib.o sctlib.o setlib.o soclib.o sqllib.o strlib.o \ 38 timlib.o typlib.o ut8lib.o 39 EOBJ = exec.o doany.o objutl.o 40 AOBJ = act_comp.o prg_comp.o analyze.o syntax.o token.o parser.o name.o type.o \ 41 expr.o atom.o object.o scanner.o literal.o numlit.o findid.o \ 42 error.o infile.o libpath.o symbol.o info.o stat.o fatal.o match.o 43 GOBJ = syvarutl.o traceutl.o actutl.o executl.o blockutl.o \ 44 entutl.o identutl.o chclsutl.o arrutl.o 45 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 \ 46 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 \ 47 tim_rtl.o ut8_rtl.o heaputl.o numutl.o sigutl.o striutl.o 48 DOBJ = big_rtl.o big_gmp.o cmd_win.o dir_win.o dll_win.o fil_win.o pcs_win.o pol_sel.o soc_none.o \ 49 stat_win.o tim_win.o 50 OBJ = $(MOBJ) 51 SEED7_LIB_OBJ = $(ROBJ) $(DOBJ) 52 DRAW_LIB_OBJ = gkb_rtl.o drw_win.o gkb_win.o 53 CONSOLE_LIB_OBJ = kbd_rtl.o con_win.o 54 DATABASE_LIB_OBJ = sql_base.o sql_db2.o sql_fire.o sql_lite.o sql_my.o sql_oci.o sql_odbc.o \ 55 sql_post.o sql_srv.o sql_tds.o 56 COMP_DATA_LIB_OBJ = typ_data.o rfl_data.o ref_data.o listutl.o flistutl.o typeutl.o datautl.o 57 COMPILER_LIB_OBJ = $(POBJ) $(LOBJ) $(EOBJ) $(AOBJ) $(GOBJ) 58 59 MSRC = s7.c 60 PSRC = runerr.c option.c primitiv.c 61 LSRC = actlib.c arrlib.c biglib.c binlib.c blnlib.c bstlib.c chrlib.c cmdlib.c conlib.c dcllib.c \ 62 drwlib.c enulib.c fillib.c fltlib.c hshlib.c intlib.c itflib.c kbdlib.c lstlib.c pcslib.c \ 63 pollib.c prclib.c prglib.c reflib.c rfllib.c sctlib.c setlib.c soclib.c sqllib.c strlib.c \ 64 timlib.c typlib.c ut8lib.c 65 ESRC = exec.c doany.c objutl.c 66 ASRC = act_comp.c prg_comp.c analyze.c syntax.c token.c parser.c name.c type.c \ 67 expr.c atom.c object.c scanner.c literal.c numlit.c findid.c \ 68 error.c infile.c libpath.c symbol.c info.c stat.c fatal.c match.c 69 GSRC = syvarutl.c traceutl.c actutl.c executl.c blockutl.c \ 70 entutl.c identutl.c chclsutl.c arrutl.c 71 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 \ 72 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 \ 73 tim_rtl.c ut8_rtl.c heaputl.c numutl.c sigutl.c striutl.c 74 DSRC = big_rtl.c big_gmp.c cmd_win.c dir_win.c dll_win.c fil_win.c pcs_win.c pol_sel.c soc_none.c \ 75 stat_win.c tim_win.c 76 SRC = $(MSRC) 77 SEED7_LIB_SRC = $(RSRC) $(DSRC) 78 DRAW_LIB_SRC = gkb_rtl.c drw_win.c gkb_win.c 79 CONSOLE_LIB_SRC = kbd_rtl.c con_win.c 80 DATABASE_LIB_SRC = sql_base.c sql_db2.c sql_fire.c sql_lite.c sql_my.c sql_oci.c sql_odbc.c \ 81 sql_post.c sql_srv.c sql_tds.c 82 COMP_DATA_LIB_SRC = typ_data.c rfl_data.c ref_data.c listutl.c flistutl.c typeutl.c datautl.c 83 COMPILER_LIB_SRC = $(PSRC) $(LSRC) $(ESRC) $(ASRC) $(GSRC) 84 85 s7: ..\bin\s7.exe ..\prg\s7.exe 86 ..\bin\s7 -l ..\lib level 87 @echo. 88 @echo Use 'make s7c' (with your make command) to create the compiler. 89 @echo. 90 91 s7c: ..\bin\s7c.exe ..\prg\s7c.exe 92 @echo. 93 @echo Use 'make test' (with your make command) to check Seed7. 94 @echo. 95 96 ..\bin\s7.exe: levelup.exe next_lvl $(OBJ) $(ALL_S7_LIBS) 97 $(CC) $(LDFLAGS) $(OBJ) $(ALL_S7_LIBS) $(SYSTEM_DRAW_LIBS) $(SYSTEM_CONSOLE_LIBS) $(SYSTEM_DATABASE_LIBS) $(SYSTEM_LIBS) $(ADDITIONAL_SYSTEM_LIBS) -o ..\bin\s7.exe 98 del next_lvl 99 100 ..\prg\s7.exe: ..\bin\s7.exe 101 copy ..\bin\s7.exe ..\prg /Y 102 103 ..\bin\s7c.exe: ..\prg\s7c.exe 104 copy ..\prg\s7c.exe ..\bin /Y 105 106 ..\prg\s7c.exe: ..\prg\s7c.sd7 $(ALL_S7_LIBS) 107 ..\bin\s7 -l ..\lib ..\prg\s7c -l ..\lib -b ..\bin -O2 ..\prg\s7c 108 109 levelup.exe: levelup.c 110 $(CC) levelup.c -o levelup 111 112 next_lvl: levelup.exe 113 .\levelup.exe 114 echo X > next_lvl 115 116 sql_db2.o: sql_db2.c 117 $(CC) -c $(CPPFLAGS) $(DB2_INCLUDE_OPTION) $(CFLAGS) $< -o $@ 118 119 sql_srv.o: sql_srv.c 120 $(CC) -c $(CPPFLAGS) $(SQL_SERVER_INCLUDE_OPTION) $(CFLAGS) $< -o $@ 121 122 all: depend 123 $(MAKE) -f mk_tcc_w.mak s7 s7c 124 125 clear: clean 126 127 clean: 128 del *.o 129 del ..\bin\*.a 130 del ..\bin\s7.exe 131 del ..\bin\s7c.exe 132 del ..\prg\s7.exe 133 del ..\prg\s7c.exe 134 del depend 135 del macros 136 del chkccomp.h 137 del base.h 138 del settings.h 139 del version.h 140 del setwpath.exe 141 del levelup.exe 142 del next_lvl 143 @echo. 144 @echo Use 'make depend' (with your make command) to create the dependencies. 145 @echo. 146 147 distclean: clean 148 copy level_bk.h level.h /Y 149 del vers_tcc_w.h 150 151 test: 152 ..\bin\s7 -l ..\lib ..\prg\chk_all build 153 @echo. 154 @echo Open a console as administrator, go to the directory seed7/src and 155 @echo use 'make install' (with your make command) to install Seed7. 156 @echo. 157 158 install: setwpath.exe 159 .\setwpath.exe add ..\bin 160 161 uninstall: setwpath.exe 162 .\setwpath.exe remove ..\bin 163 164 dep: depend 165 166 strip: 167 strip ..\bin\s7.exe 168 169 chkccomp.h: 170 echo #define LIST_DIRECTORY_CONTENTS "dir" > chkccomp.h 171 172 base.h: 173 echo #define PATH_DELIMITER '\\' > base.h 174 echo #define OS_STRI_WCHAR >> base.h 175 echo #define QUOTE_WHOLE_SHELL_COMMAND >> base.h 176 echo #define OBJECT_FILE_EXTENSION ".o" >> base.h 177 echo #define EXECUTABLE_FILE_EXTENSION ".exe" >> base.h 178 echo #define C_COMPILER "$(CC)" >> base.h 179 echo #define CC_OPT_VERSION_INFO "-v" >> base.h 180 echo #define CC_FLAGS "" >> base.h 181 echo #define CC_ERROR_FILEDES 2 >> base.h 182 echo #define CC_VERSION_INFO_FILEDES 1 >> base.h 183 echo #define LINKER_OPT_OUTPUT_FILE "-o " >> base.h 184 echo #define INT_DIV_BY_ZERO_POPUP >> base.h 185 echo #define DO_SIGFPE_WITH_DIV_BY_ZERO 1 >> base.h 186 echo #define SYSTEM_LIBS "$(SYSTEM_LIBS)" >> base.h 187 188 settings.h: 189 echo #define MAKE_UTILITY_NAME "$(MAKE)" > settings.h 190 echo #define MAKEFILE_NAME "mk_tcc_w.mak" >> settings.h 191 echo #define SEARCH_PATH_DELIMITER ';' >> settings.h 192 echo #define DEFINE_COMMAND_LINE_TO_ARGV_W >> settings.h 193 echo #define CONSOLE_WCHAR >> settings.h 194 echo #define os_getch getch >> settings.h 195 echo #define OS_GETCH_READS_BYTES >> settings.h 196 echo #define LIBRARY_FILE_EXTENSION ".a" >> settings.h 197 echo #define CC_OPT_DEBUG_INFO "-g" >> settings.h 198 echo #define CC_OPT_NO_WARNINGS "-w" >> settings.h 199 echo #define LINKER_FLAGS "$(LDFLAGS)" >> settings.h 200 echo #define SYSTEM_DRAW_LIBS "$(SYSTEM_DRAW_LIBS)" >> settings.h 201 echo #define SYSTEM_CONSOLE_LIBS "$(SYSTEM_CONSOLE_LIBS)" >> settings.h 202 echo #define SEED7_LIB "$(SEED7_LIB)" >> settings.h 203 echo #define DRAW_LIB "$(DRAW_LIB)" >> settings.h 204 echo #define CONSOLE_LIB "$(CONSOLE_LIB)" >> settings.h 205 echo #define DATABASE_LIB "$(DATABASE_LIB)" >> settings.h 206 echo #define COMP_DATA_LIB "$(COMP_DATA_LIB)" >> settings.h 207 echo #define COMPILER_LIB "$(COMPILER_LIB)" >> settings.h 208 209 version.h: chkccomp.h base.h settings.h 210 $(CC) chkccomp.c -o chkccomp.exe 211 .\chkccomp.exe version.h 212 del chkccomp.exe 213 $(CC) setpaths.c -o setpaths.exe 214 .\setpaths.exe S7_LIB_DIR=$(S7_LIB_DIR) SEED7_LIBRARY=$(SEED7_LIBRARY) >> version.h 215 del setpaths.exe 216 $(CC) setwpath.c -luser32 -ladvapi32 -o setwpath.exe 217 copy version.h vers_tcc_w.h /Y 218 219 depend: version.h 220 @echo Working without C header dependency checks. 221 @echo. 222 @echo Use 'make' (with your make command) to create the interpreter. 223 @echo. 224 225 ..\bin\$(SEED7_LIB): $(SEED7_LIB_OBJ) 226 $(AR) ..\bin\$(SEED7_LIB) $(SEED7_LIB_OBJ) 227 228 ..\bin\$(DRAW_LIB): $(DRAW_LIB_OBJ) 229 $(AR) ..\bin\$(DRAW_LIB) $(DRAW_LIB_OBJ) 230 231 ..\bin\$(CONSOLE_LIB): $(CONSOLE_LIB_OBJ) 232 $(AR) ..\bin\$(CONSOLE_LIB) $(CONSOLE_LIB_OBJ) 233 234 ..\bin\$(DATABASE_LIB): $(DATABASE_LIB_OBJ) 235 $(AR) ..\bin\$(DATABASE_LIB) $(DATABASE_LIB_OBJ) 236 237 ..\bin\$(COMP_DATA_LIB): $(COMP_DATA_LIB_OBJ) 238 $(AR) ..\bin\$(COMP_DATA_LIB) $(COMP_DATA_LIB_OBJ) 239 240 ..\bin\$(COMPILER_LIB): $(COMPILER_LIB_OBJ) 241 $(AR) ..\bin\$(COMPILER_LIB) $(COMPILER_LIB_OBJ) 242 243 ..\bin\bas7.exe: ..\prg\bas7.sd7 ..\bin\s7c.exe 244 ..\bin\s7c.exe -l ..\lib -b ..\bin -O2 ..\prg\bas7 245 copy ..\prg\bas7.exe ..\bin /Y 246 del ..\prg\bas7.exe 247 248 ..\bin\bigfiles.exe: ..\prg\bigfiles.sd7 ..\bin\s7c.exe 249 ..\bin\s7c.exe -l ..\lib -b ..\bin -O2 ..\prg\bigfiles 250 copy ..\prg\bigfiles.exe ..\bin /Y 251 del ..\prg\bigfiles.exe 252 253 ..\bin\calc7.exe: ..\prg\calc7.sd7 ..\bin\s7c.exe 254 ..\bin\s7c.exe -l ..\lib -b ..\bin -O2 ..\prg\calc7 255 copy ..\prg\calc7.exe ..\bin /Y 256 del ..\prg\calc7.exe 257 258 ..\bin\cat.exe: ..\prg\cat.sd7 ..\bin\s7c.exe 259 ..\bin\s7c.exe -l ..\lib -b ..\bin -O2 ..\prg\cat 260 copy ..\prg\cat.exe ..\bin /Y 261 del ..\prg\cat.exe 262 263 ..\bin\comanche.exe: ..\prg\comanche.sd7 ..\bin\s7c.exe 264 ..\bin\s7c.exe -l ..\lib -b ..\bin -O2 ..\prg\comanche 265 copy ..\prg\comanche.exe ..\bin /Y 266 del ..\prg\comanche.exe 267 268 ..\bin\db7.exe: ..\prg\db7.sd7 ..\bin\s7c.exe 269 ..\bin\s7c.exe -l ..\lib -b ..\bin -O2 ..\prg\db7 270 copy ..\prg\db7.exe ..\bin /Y 271 del ..\prg\db7.exe 272 273 ..\bin\diff7.exe: ..\prg\diff7.sd7 ..\bin\s7c.exe 274 ..\bin\s7c.exe -l ..\lib -b ..\bin -O2 ..\prg\diff7 275 copy ..\prg\diff7.exe ..\bin /Y 276 del ..\prg\diff7.exe 277 278 ..\bin\find7.exe: ..\prg\find7.sd7 ..\bin\s7c.exe 279 ..\bin\s7c.exe -l ..\lib -b ..\bin -O2 ..\prg\find7 280 copy ..\prg\find7.exe ..\bin /Y 281 del ..\prg\find7.exe 282 283 ..\bin\findchar.exe: ..\prg\findchar.sd7 ..\bin\s7c.exe 284 ..\bin\s7c.exe -l ..\lib -b ..\bin -O2 ..\prg\findchar 285 copy ..\prg\findchar.exe ..\bin /Y 286 del ..\prg\findchar.exe 287 288 ..\bin\ftp7.exe: ..\prg\ftp7.sd7 ..\bin\s7c.exe 289 ..\bin\s7c.exe -l ..\lib -b ..\bin -O2 ..\prg\ftp7 290 copy ..\prg\ftp7.exe ..\bin /Y 291 del ..\prg\ftp7.exe 292 293 ..\bin\ftpserv.exe: ..\prg\ftpserv.sd7 ..\bin\s7c.exe 294 ..\bin\s7c.exe -l ..\lib -b ..\bin -O2 ..\prg\ftpserv 295 copy ..\prg\ftpserv.exe ..\bin /Y 296 del ..\prg\ftpserv.exe 297 298 ..\bin\hd.exe: ..\prg\hd.sd7 ..\bin\s7c.exe 299 ..\bin\s7c.exe -l ..\lib -b ..\bin -O2 ..\prg\hd 300 copy ..\prg\hd.exe ..\bin /Y 301 del ..\prg\hd.exe 302 303 ..\bin\make7.exe: ..\prg\make7.sd7 ..\bin\s7c.exe 304 ..\bin\s7c.exe -l ..\lib -b ..\bin -O2 ..\prg\make7 305 copy ..\prg\make7.exe ..\bin /Y 306 del ..\prg\make7.exe 307 308 ..\bin\sql7.exe: ..\prg\sql7.sd7 ..\bin\s7c.exe 309 ..\bin\s7c.exe -l ..\lib -b ..\bin -O2 ..\prg\sql7 310 copy ..\prg\sql7.exe ..\bin /Y 311 del ..\prg\sql7.exe 312 313 ..\bin\sydir7.exe: ..\prg\sydir7.sd7 ..\bin\s7c.exe 314 ..\bin\s7c.exe -l ..\lib -b ..\bin -O2 ..\prg\sydir7 315 copy ..\prg\sydir7.exe ..\bin /Y 316 del ..\prg\sydir7.exe 317 318 ..\bin\tar7.exe: ..\prg\tar7.sd7 ..\bin\s7c.exe 319 ..\bin\s7c.exe -l ..\lib -b ..\bin -O2 ..\prg\tar7 320 copy ..\prg\tar7.exe ..\bin /Y 321 del ..\prg\tar7.exe 322 323 ..\bin\toutf8.exe: ..\prg\toutf8.sd7 ..\bin\s7c.exe 324 ..\bin\s7c.exe -l ..\lib -b ..\bin -O2 ..\prg\toutf8 325 copy ..\prg\toutf8.exe ..\bin /Y 326 del ..\prg\toutf8.exe 327 328 ..\bin\which.exe: ..\prg\which.sd7 ..\bin\s7c.exe 329 ..\bin\s7c.exe -l ..\lib -b ..\bin -O2 ..\prg\which 330 copy ..\prg\which.exe ..\bin /Y 331 del ..\prg\which.exe 332 333 bas7: ..\bin\bas7.exe 334 bigfiles: ..\bin\bigfiles.exe 335 calc7: ..\bin\calc7.exe 336 cat: ..\bin\cat.exe 337 comanche: ..\bin\comanche.exe 338 db7: ..\bin\db7.exe 339 diff7: ..\bin\diff7.exe 340 find7: ..\bin\find7.exe 341 findchar: ..\bin\findchar.exe 342 ftp7: ..\bin\ftp7.exe 343 ftpserv: ..\bin\ftpserv.exe 344 hd: ..\bin\hd.exe 345 make7: ..\bin\make7.exe 346 sql7: ..\bin\sql7.exe 347 sydir7: ..\bin\sydir7.exe 348 tar7: ..\bin\tar7.exe 349 toutf8: ..\bin\toutf8.exe 350 which: ..\bin\which.exe 351 352 utils: ..\bin\bas7.exe ..\bin\bigfiles.exe ..\bin\calc7.exe ..\bin\cat.exe ..\bin\comanche.exe ..\bin\db7.exe \ 353 ..\bin\diff7.exe ..\bin\find7.exe ..\bin\findchar.exe ..\bin\ftp7.exe ..\bin\ftpserv.exe ..\bin\hd.exe \ 354 ..\bin\make7.exe ..\bin\sql7.exe ..\bin\sydir7.exe ..\bin\tar7.exe ..\bin\toutf8.exe ..\bin\which.exe 355 356 wc: $(SRC) 357 @echo SRC: 358 wc $(SRC) 359 @echo SEED7_LIB_SRC: 360 wc $(SEED7_LIB_SRC) 361 @echo DRAW_LIB_SRC: 362 wc $(DRAW_LIB_SRC) 363 @echo CONSOLE_LIB_SRC: 364 wc $(CONSOLE_LIB_SRC) 365 @echo DATABASE_LIB_SRC: 366 wc $(DATABASE_LIB_SRC) 367 @echo COMP_DATA_LIB_SRC: 368 wc $(COMP_DATA_LIB_SRC) 369 @echo COMPILER_LIB_SRC: 370 wc $(COMPILER_LIB_SRC) 371 372 lint: $(SRC) 373 lint -p $(SRC) $(SYSTEM_DRAW_LIBS) $(SYSTEM_CONSOLE_LIBS) $(SYSTEM_DATABASE_LIBS) $(SYSTEM_LIBS) $(ADDITIONAL_SYSTEM_LIBS) 374 375 lint2: $(SRC) 376 lint -Zn2048 $(SRC) $(SYSTEM_DRAW_LIBS) $(SYSTEM_CONSOLE_LIBS) $(SYSTEM_DATABASE_LIBS) $(SYSTEM_LIBS) $(ADDITIONAL_SYSTEM_LIBS) 377 378 ifeq (macros,$(wildcard macros)) 379 include macros 380 endif