!set link = "make -f %s", mkfname#mkfext ! "M\t= %s\n",mkfname#>mkfext !if defined topspeed then ! "TSLIBS\t= %s\n","libts"#libext !else ! "TSLIBS\t= \n" !end !if defined include_place then ! "INCL\t= %s\n", include_place !else ! "INCL\t= .\n" !end !if not genlib then ! "XDSLIB\t= %s\n","libxds"#libext !end !if xmapp then ! "XLIBS\t= -L/usr/X11R6/lib -lXm -lXt -lX11\n" !if (env_target="x86linux") then ! "XMACLIBS\t= %s %s\n","libmac_X11"#libext,"libmac_Xm"#libext !end !elsif xapp then ! "XLIBS\t= -L/usr/X11R6/lib -lX11\n" !if (env_target="x86linux") then ! "XMACLIBS\t= %s\n","libmac_X11"#libext !end !end !if genlib then !if defined libname and (libname#"") then ! "TARGET\t= %s\n",libname#>libext !elsif defined project and (project#"") then ! "TARGET\t= %s\n",project#>exeext !else ! "TARGET\t= %s\n","libhello"#>libext !end !else !if defined exename and (exename#"") then ! "TARGET\t= %s\n",exename#>exeext !elsif defined project and (project#"") then ! "TARGET\t= %s\n",project#>exeext !else ! { main : "TARGET\t= %s\n",#>exeext } !end !end !if not defined usestaticclibs then !new usestaticclibs- !end !if defined ccomp then !elsif env_target="free_bsd" then ! "CDEFS\t= -D_unix -D_free_bsd -DX2C_no_spawn -DX2C_strcmp\n" ! "CF\t= -O2 -c -I$(INCL)\n" ! "CC\t= cc\n" !new ccomp = $$(CC) $$(CDEFS) $$(CF) -o %s %s !elsif (env_target="linux") or (env_target="x86linux") then ! "CDEFS\t= -D_unix -D_linux -DX2C_no_spawn -DX2C_strcmp\n" ! "CF\t= -O2 -g -I$(INCL) -c\n" ! "CC\t= gcc\n" !if defined linuxaout_support and linuxaout_support then ! "OBJFF\t= -bi486-linuxaout\n" !else ! "OBJFF\t=\n" !end !if usestaticclibs then ! "LFLAGS\t= -static\n" ! else ! "LFLAGS\t=\n" !end !new ccomp = $$(CC) $$(OBJFF) $$(CDEFS) $$(CF) -o %s %s !end !if defined asmcomp then !elsif (env_target="x86linux") or (env_target="linux") then !new asmcomp = as -o %s %s !end # ------------------ objects enumeration ------------------ # ------------------- ! "OBJ="; { obj : " \\\n\t%s",# } # ------------------- target make rules ------------------- # ----------------- ! "XLIBS\t= -L/usr/X11R6/lib -lX11\n" !if (env_target="x86linux") then ! "XMACLIBS\t= %s\n","libmac_X11"#libext !end !if genlib then ! "$(TARGET) : $(M) $(OBJ)\n" !if (env_target="linux") or (env_target="x86linux") or (env_target="free_bsd") or (env_target="sunos4") or (env_target="aix") then ! "\trm -f $(TARGET)\n" ! "\tar q $(TARGET) $(OBJ)\n" ! "\tranlib $(TARGET)\n" !else ! "\tar q $(TARGET) $(OBJ)\n" !end !else ! "$(TARGET) : $(OBJ) $(XDSLIB)\n" !if (env_target="x86linux") then # ! "\tgcc $(LFLAGS) -o $(TARGET) $(OBJ) $(XLIBS) $(TSLIBS) $(XDSLIB) $(XMACLIBS) -lm -lncurses\n" ! "\tgcc $(LFLAGS) -o $(TARGET) $(OBJ) $(XLIBS) $(XDSLIB) $(XMACLIBS) -lm libpng.a libz.a libjpeg.a \n" !elsif (env_target="linux") or (env_target="aix") then ! "\tgcc $(LFLAGS) -o $(TARGET) $(OBJFF) $(OBJ) $(XLIBS) $(XDSLIB) -lm\n" !else ! "\tcc $(LFLAGS) -o $(TARGET) $(OBJ) $(XLIBS) $(XDSLIB) -lm\n" !end !end # ----------------- Dependency information ---------------- # ---------------------- ! { asm : "%-12s : $(M)",#>objext; " %s\n\t",#asmext; asmcomp,#>objext,#asmext; "\n\n" } ! { c : { header : "%-24s : %s\n",^#>objext,#header } \ "%-24s : $(M) %s\n\t",#>objext,#; ccomp,#>objext,#; "\n\n" } # end of makefile