From: <fd...@fr...> - 2005-04-28 19:07:55
|
I saw some difference between makefile.vc allegro 4.2 and makefile.vc allegro 4.18 to these points (but i'mcompletly blind for understand them) : # -------- Work out the absolute pathnames for some MSVC tools to avoid confusion -------- # -------- optimised build -------- # -------- list platform specific objects and programs -------- # -------- rules for installing and removing the library files -------- # -------- link as a static library -------- # -------- link as a DLL -------- ----- Original Message ----- From: "AJ" <aj...@vi...> To: <all...@li...> Sent: Thursday, April 28, 2005 6:52 PM Subject: Re: [AL] error in makefile.vc in allegro beta 2 i have no solid evidence, but my gut says that the makefile.vc from 4.2 had spaces replacing tab characters. attached is a copy of makefile.vc for 4.2b2 that i have successfully compiled using msvc. please try it. aj. Fr=E9d=E9ric Drouillon wrote: >as i could not compile allegro 4.2 for mscv 6 with DevC++ et XP > >i try to remplace the "makefile.vc" of the allegro 4.2 version by the >"makefile.vc" of an older version (4.18) >and after that i could compile : >alleg.lib, alleg42.dll >alld.lib, >allp.lib, allp42.dll >alleg_s.lib >alld_s.lib, with an error at the end with make = ***[tests/win/dibgrab.exe] >error 1103 >alllp_s > >i could not compile alld42.dll > >so i suppose that there is an error in the makefile.vc of the new = allegro >version but i'm sorry, i'm not able to corrige it > >FD > > > > >------------------------------------------------------- >SF.Net email is sponsored by: Tell us your software development plans! >Take this survey and enter to win a one-year sub to SourceForge.net >Plus IDC's 2005 look-ahead and a copy of this survey >Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=3D105hix > > -------------------------------------------------------------------------= --- ---- > # > # Rules for building the Allegro library with MSVC. This file is = included > # by the primary makefile, and should not be used directly. > # > # To path MSVC so it can be used from the commandline, run the > # vcvars32.bat file which can be found in your MSVC bin directory. > # > # To use MSVC7 specific options, the variable COMPILER_MSVC7 must be = set. The > # fix.bat script should do this automatically if run as `fix msvc7' > # > # To use the Intel commandline compiler instead of the MSVC compiler, > # COMPILER_ICL must be set. Again, `fix icl' should take care of = this. > # > # This platform uses GCC for building the assembler sources and calculating > # source dependencies, so you'll need to have that installed in the = form of > # DJGPP, MinGW or Cygwin. > # > # The "depend" target uses sed. > # > # See makefile.all for a list of the available targets. > > > > # -------- define some variables that the primary makefile will use -------- > > PLATFORM =3D MSVC > RUNNER =3D obj/msvc/runner.exe > GCC =3D gcc > EXE =3D .exe > OBJ =3D .obj > HTML =3D html > > PLATFORM_DIR =3D obj/msvc > > ifdef ALLEGRO_USE_CYGWIN > UNIX_TOOLS =3D 1 > GCCFLAGS =3D -mno-cygwin > endif > > ifneq (,$(findstring /sh.exe,$(SHELL))) > UNIX_TOOLS =3D 1 > endif > > > > ifdef STATICLINK > > # -------- link as a static library -------- > > OBJ_DIR =3D obj/msvc/$(VERSION)_s > IMPLIB_BASENAME =3D $(VERSION)_s.lib > IMPLIB_NAME =3D lib/msvc/$(IMPLIB_BASENAME) > LIB_NAME =3D $(IMPLIB_NAME) > > else > > # -------- link as a DLL -------- > > OBJ_DIR =3D obj/msvc/$(VERSION) > DLL_BASENAME =3D $(VERSION)$(LIBRARY_VERSION).dll > DLL_NAME =3D lib/msvc/$(DLL_BASENAME) > IMPLIB_BASENAME =3D $(VERSION).lib > IMPLIB_NAME =3D lib/msvc/$(IMPLIB_BASENAME) > LIB_NAME =3D $(DLL_NAME) $(IMPLIB_NAME) > > endif > > > > # -------- check that environment path variables are set -------- > > .PHONY: badwin badmsvc badspaces > > ifeq ($(OS),Windows_NT) > WINSYSDIR =3D $(SYSTEMROOT) > ifeq ($(WINSYSDIR),) > WINSYSDIR =3D $(SystemRoot) > endif > WINSUBDIR =3D system32 > else > WINSYSDIR =3D $(WINDIR) > ifeq ($(WINSYSDIR),) > WINSYSDIR =3D $(windir) > endif > WINSUBDIR =3D system > endif > > ifneq ($(WINSYSDIR),) > WINDIR_U =3D $(subst \,/,$(WINSYSDIR)/$(WINSUBDIR)) > WINDIR_D =3D $(subst /,\,$(WINSYSDIR)/$(WINSUBDIR)) > else > badwin: > @echo Your SYSTEMROOT or windir environment variable is not set! > endif > > ifdef MSVCDIR > MSVCDIR_U =3D $(subst \,/,$(MSVCDIR)) > MSVCDIR_D =3D $(subst /,\,$(MSVCDIR)) > else > ifdef MSVCDir > MSVCDIR_U =3D $(subst \,/,$(MSVCDir)) > MSVCDIR_D =3D $(subst /,\,$(MSVCDir)) > else > badmsvc: > @echo Your MSVCDIR environment variable is not set! > @echo See the docs/build/msvc.txt file! > endif > endif > > NULLSTRING :=3D > SPACE :=3D $(NULLSTRING) # special magic to get an isolated space = character > > ifneq ($(findstring $(SPACE),$(MSVCDIR)),) > badspaces: > @echo There are spaces in your MSVCDIR environment variable: > @echo please change it to the 8.3 short filename version, > @echo or move your compiler to a different directory. > endif > > ifneq ($(findstring $(SPACE),$(MSVCDir)),) > badspaces: > @echo There are spaces in your MSVCDir environment variable: > @echo please change it to the 8.3 short filename version, > @echo or move your compiler to a different directory. > endif > > > > # -------- Work out the absolute pathnames for some MSVC tools to = avoid confusion -------- > > ifdef COMPILER_ICL > MSVC_CL =3D icl > else > MSVC_CL =3D $(MSVCDIR_U)/bin/cl > endif > MSVC_LINK =3D $(MSVCDIR_U)/bin/link > MSVC_LIB =3D $(MSVCDIR_U)/bin/lib > MSVC_RC =3D rc > > > > # -------- give a sensible default target for make without any args -------- > > .PHONY: _default > > _default: default > > > > # -------- decide what compiler options to use -------- > > ifdef WARNMODE > WFLAGS =3D -W3 -WX > else > WFLAGS =3D -W1 > endif > > ifdef STATICRUNTIME > RUNTIME_FLAGS =3D -MT > else > RUNTIME_FLAGS =3D -MD > endif > > ifdef DEBUGMODE > > # -------- debugging build -------- > > CFLAGS =3D -DDEBUGMODE=3D$(DEBUGMODE) $(WFLAGS) -Gd -Zi = $(RUNTIME_FLAGS)d > SFLAGS =3D -DDEBUGMODE=3D$(DEBUGMODE) -Wall > LFLAGS =3D -debug -debugtype:cv > > else > ifdef PROFILEMODE > > # -------- profiling build -------- > > CFLAGS =3D $(WFLAGS) -Gd -Ox -GB $(RUNTIME_FLAGS) > SFLAGS =3D -Wall > LFLAGS =3D -profile > > else > > # -------- optimised build -------- > > CFLAGS =3D $(WFLAGS) -Gd $(RUNTIME_FLAGS) > SFLAGS =3D -Wall > LFLAGS =3D -release > LIBPARMS =3D > > ifdef COMPILER_ICL > CFLAGS +=3D -Os -G7 -QaxPN > else > ifdef TARGET_ARCH_EXCL > CFLAGS +=3D -O2 -G$(TARGET_ARCH_EXCL) > else > CFLAGS +=3D -O2 -GB > endif > endif > > ifdef COMPILER_MSVC7 > CFLAGS +=3D -GL > LFLAGS +=3D -LTCG > LIBPARMS +=3D -LTCG > endif > > endif > endif > > > > # -------- list platform specific objects and programs -------- > > VPATH =3D src/win src/i386 src/misc tests/win tools/win > > OBJECT_LIST =3D $(COMMON_OBJECTS) $(I386_OBJECTS) $(basename $(notdir $(ALLEGRO_SRC_WIN_FILES))) > > LIBRARIES =3D kernel32.lib user32.lib gdi32.lib comdlg32.lib ole32.lib = \ > dinput.lib ddraw.lib dxguid.lib winmm.lib dsound.lib > > PROGRAMS =3D dibgrab dibhello dibsound dxwindow scrsave wfixicon > > dibgrab: tests/win/dibgrab.exe > dibhello: tests/win/dibhello.exe > dibsound: tests/win/dibsound.exe > dxwindow: tests/win/dxwindow.exe > scrsave: tests/win/scrsave.scr > wfixicon: tools/win/wfixicon.exe > > > > # -------- rules for installing and removing the library files = -------- > > INSTALLDIR =3D $(MSVCDIR_U) > LIBDIR =3D lib > INCDIR =3D include > > > ifdef UNIX_TOOLS > > $(WINDIR_U)/$(DLL_BASENAME): $(DLL_NAME) > cp lib/msvc/$(DLL_BASENAME) $(WINDIR_U) > > $(MSVCDIR_U)/lib/$(IMPLIB_BASENAME): $(IMPLIB_NAME) $(MSVCDIR_U)/lib > cp lib/msvc/$(IMPLIB_BASENAME) $(MSVCDIR_U)/lib > > else > > $(WINDIR_U)/$(DLL_BASENAME): $(DLL_NAME) > copy lib\msvc\$(DLL_BASENAME) $(WINDIR_D) > > $(MSVCDIR_U)/lib/$(IMPLIB_BASENAME): $(IMPLIB_NAME) $(MSVCDIR_U)/lib > copy lib\msvc\$(IMPLIB_BASENAME) $(MSVCDIR_D)\lib > > endif > > > HEADERS =3D $(MSVCDIR_U)/include/winalleg.h \ > $(MSVCDIR_U)/include/allegro/platform/aintwin.h \ > $(MSVCDIR_U)/include/allegro/platform/al386vc.h \ > $(MSVCDIR_U)/include/allegro/platform/almsvc.h \ > $(MSVCDIR_U)/include/allegro/platform/alplatf.h \ > $(MSVCDIR_U)/include/allegro/platform/astdint.h \ > $(MSVCDIR_U)/include/allegro/platform/alwin.h > > INSTALL_FILES =3D $(MSVCDIR_U)/lib/$(IMPLIB_BASENAME) > > ifndef STATICLINK > INSTALL_FILES +=3D $(WINDIR_U)/$(DLL_BASENAME) > endif > > INSTALL_FILES +=3D $(HEADERS) > > install: generic-install > @echo The $(DESCRIPTION) $(PLATFORM) library has been installed. > > UNINSTALL_FILES =3D $(MSVCDIR_U)/lib/alleg.lib \ > $(MSVCDIR_U)/lib/alld.lib \ > $(MSVCDIR_U)/lib/allp.lib \ > $(MSVCDIR_U)/lib/alleg_s.lib \ > $(MSVCDIR_U)/lib/alld_s.lib \ > $(MSVCDIR_U)/lib/allp_s.lib \ > $(WINDIR_U)/alleg$(LIBRARY_VERSION).dll \ > $(WINDIR_U)/alld$(LIBRARY_VERSION).dll \ > $(WINDIR_U)/allp$(LIBRARY_VERSION).dll \ > $(HEADERS) > > uninstall: generic-uninstall > @echo All gone! > > > > # -------- helper function for compressing the executables -------- > > .PHONY: compress > > compress: > ifdef UPX_BIN > $(UPX_BIN) demo/*.exe examples/*.exe setup/*.exe tests/*.exe = tools/*.exe lib/msvc/all*.dll > else > @echo No executable compressor specified! You must set the environment variable > @echo UPX_BIN to point to upx.exe. > endif > > > > # -------- test capabilities -------- > > TEST_CPP =3D @echo ...integrated > > include makefile.tst > > > > # -------- finally, we get to the fun part... -------- > > ifdef STATICLINK > > # -------- link as a static library -------- > > define MAKE_LIB > $(RUNNER) $(MSVC_LIB) @ -nologo $(LIBPARMS) -out:$(LIB_NAME) = $(OBJECTS) > endef > > COMPILE_FLAGS =3D -DALLEGRO_STATICLINK > > else > > # -------- link as a DLL -------- > > define MAKE_LIB > $(RUNNER) $(MSVC_LINK) @ -nologo $(LFLAGS) -dll -def:lib/msvc/allegro.def -out:$(DLL_NAME) = -implib:$(IMPLIB_N AME) $(OBJECTS) $(LIBRARIES) > endef > > endif > > COMPILE_FLAGS +=3D $(subst src/,-DALLEGRO_SRC ,$(findstring src/, $<))$(CFLAGS) > > $(OBJ_DIR)/%.obj: %.c $(RUNNER) > $(RUNNER) $(MSVC_CL) @ -nologo $(COMPILE_FLAGS) -I. -I./include -Fo$@ = -c $< > > $(OBJ_DIR)/%.obj: %.cpp $(RUNNER) > $(RUNNER) $(MSVC_CL) @ -nologo $(COMPILE_FLAGS) -I. -I./include -Fo$@ = -c $< > > $(OBJ_DIR)/%.obj: %.s > $(GCC) $(SFLAGS) -I. -I./include -x assembler-with-cpp -o $@ -c $< > > $(OBJ_DIR)/%.obj: %.rc > $(MSVC_RC) -i"include" -fo$@ $< > > obj/msvc/%.res: %.rc > $(MSVC_RC) -fo$@ $< > > tests/win/dibsound.exe: $(OBJ_DIR)/dibsound.obj obj/msvc/dibsound.res $(IMPLIB_NAME) $(RUNNER) > $(RUNNER) $(MSVC_LINK) @ -nologo $(LFLAGS) -subsystem:windows -out:tests/win/dibsound.exe $(OBJ_DIR)/dibsound.obj obj/msvc/dibsound.res $(IMPLIB_NAME) = $(LIBRARIES) > > tests/win/dxwindow.exe: $(OBJ_DIR)/dxwindow.obj obj/msvc/dxwindow.res $(IMPLIB_NAME) $(RUNNER) > $(RUNNER) $(MSVC_LINK) @ -nologo $(LFLAGS) -subsystem:windows -out:tests/win/dxwindow.exe $(OBJ_DIR)/dxwindow.obj obj/msvc/dxwindow.res $(IMPLIB_NAME) = $(LIBRARIES) > > tests/win/%.exe: $(OBJ_DIR)/%.obj $(IMPLIB_NAME) $(RUNNER) > $(RUNNER) $(MSVC_LINK) @ -nologo $(LFLAGS) -subsystem:windows -out:$@ = $< $(IMPLIB_NAME) $(LIBRARIES) > > tests/win/scrsave.scr: $(OBJ_DIR)/scrsave.obj obj/msvc/scrsave.res $(IMPLIB_NAME) $(RUNNER) > $(RUNNER) $(MSVC_LINK) @ -nologo $(LFLAGS) -subsystem:windows -out:tests/win/scrsave.scr $(OBJ_DIR)/scrsave.obj obj/msvc/scrsave.res $(IMPLIB_NAME) $(LIBRARIES) > > tools/win/%.exe: $(OBJ_DIR)/%.obj $(IMPLIB_NAME) $(RUNNER) > $(RUNNER) $(MSVC_LINK) @ -nologo $(LFLAGS) -subsystem:console -out:$@ = $< $(IMPLIB_NAME) $(LIBRARIES) > > obj/msvc/demo.res: demo/demo.dat tools/win/wfixicon.exe > ifdef STATICLINK > tools/win/wfixicon.exe obj/msvc/demo.ico -ro -d demo/demo.dat SHIP3 GAME_PAL > else > ifdef UNIX_TOOLS > cp tools/win/wfixicon.exe lib/msvc/wfixicon.exe > else > copy tools\win\wfixicon.exe lib\msvc\wfixicon.exe > endif > lib/msvc/wfixicon.exe obj/msvc/demo.ico -ro -d demo/demo.dat SHIP3 GAME_PAL > ifdef UNIX_TOOLS > rm lib/msvc/wfixicon.exe > else > del lib\msvc\wfixicon.exe > endif > endif > > demo/demo.exe: $(OBJ_DIR)/demo.obj obj/msvc/demo.res $(IMPLIB_NAME) $(RUNNER) > $(RUNNER) $(MSVC_LINK) @ -nologo $(LFLAGS) -subsystem:windows -out:demo/demo.exe $(OBJ_DIR)/demo.obj obj/msvc/demo.res $(IMPLIB_NAME) $(LIBRARIES) > > */%.exe: $(OBJ_DIR)/%.obj $(IMPLIB_NAME) $(RUNNER) > $(RUNNER) $(MSVC_LINK) @ -nologo $(LFLAGS) -subsystem:windows -out:$@ = $< $(IMPLIB_NAME) $(LIBRARIES) > > LINK_CONSOLE_DEPS =3D $(IMPLIB_NAME) $(RUNNER) > > define LINK_CONSOLE > $(RUNNER) $(MSVC_LINK) @ -nologo $(LFLAGS) -subsystem:console = -out:$@ $< $(IMPLIB_NAME) $(LIBRARIES) > endef > > obj/msvc/asmdef.inc: obj/msvc/asmdef.exe > obj/msvc/asmdef.exe obj/msvc/asmdef.inc > > obj/msvc/asmdef.exe: src/i386/asmdef.c include/*.h include/allegro/*.h obj/msvc/asmcapa.h $(RUNNER) > $(RUNNER) $(MSVC_CL) @ -nologo $(WFLAGS) -I. -I./include -Foobj/msvc/asmdef.obj -Feobj/msvc/asmdef.exe src/i386/asmdef.c > > obj/msvc/runner.exe: src/misc/runner.c > $(GCC) -O -Wall -Werror $(GCCFLAGS) -o obj/msvc/runner.exe src/misc/runner.c > > define LINK_WITHOUT_LIB > $(RUNNER) $(MSVC_LINK) @ -nologo $(LFLAGS) -subsystem:console = -out:$@ $^ > endef > > PLUGIN_LIB =3D lib/msvc/$(VERY_SHORT_VERSION)dat.lib > PLUGIN_DEPS =3D $(IMPLIB_NAME) $(PLUGIN_LIB) $(RUNNER) > PLUGINS_H =3D obj/msvc/plugins.h > PLUGIN_SCR =3D scv > > ifdef UNIX_TOOLS > define GENERATE_PLUGINS_H > cat tools/plugins/*.inc > obj/msvc/plugins.h > endef > else > define GENERATE_PLUGINS_H > copy /B tools\plugins\*.inc obj\msvc\plugins.h > endef > endif > > define MAKE_PLUGIN_LIB > $(RUNNER) $(MSVC_LIB) @ -nologo $(LIBPARMS) -out:$(PLUGIN_LIB) $(PLUGIN_OBJS) > endef > > define LINK_WITH_PLUGINS > $(RUNNER) $(MSVC_LINK) @ -nologo $(LFLAGS) -subsystem:windows = -out:$@ $< $(strip $(PLUGIN_LIB) $(addprefix @,$(PLUGIN_SCRIPTS)) $(IMPLIB_NAME) $(LIBRARIES)) > endef > > define LINK_CONSOLE_WITH_PLUGINS > $(RUNNER) $(MSVC_LINK) @ -nologo $(LFLAGS) -subsystem:console = -out:$@ $< $(strip $(PLUGIN_LIB) $(addprefix @,$(PLUGIN_SCRIPTS)) $(IMPLIB_NAME) $(LIBRARIES)) > endef > > > > # -------- generate automatic dependencies -------- > > DEPEND_PARAMS =3D -MM -MG -I. -I./include -DSCAN_DEPEND -DALLEGRO_MSVC > > depend: > $(GCC) $(DEPEND_PARAMS) src/*.c src/c/*.c src/i386/*.c src/misc/*.c src/win/*.c demo/*.c > _depend.tmp > $(GCC) $(DEPEND_PARAMS) docs/src/makedoc/*.c examples/*.c setup/*.c tests/*.c tests/win/*.c >> _depend.tmp > $(GCC) $(DEPEND_PARAMS) tools/*.c tools/win/*.c tools/plugins/*.c >> _depend.tmp > $(GCC) $(DEPEND_PARAMS) -x c tests/*.cpp >> _depend.tmp > $(GCC) $(DEPEND_PARAMS) -x assembler-with-cpp src/c/*.s src/i386/*.s src/misc/*.s src/win/*.s >> _depend.tmp > sed -e "s/^[a-zA-Z0-9_\/]*\///" _depend.tmp > _depend2.tmp > ifdef UNIX_TOOLS > sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/msvc\/alleg\/\1\.obj:/" = _depend2.tmp > obj/msvc/alleg/makefile.dep > sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/msvc\/alld\/\1\.obj:/" = _depend2.tmp > obj/msvc/alld/makefile.dep > sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/msvc\/allp\/\1\.obj:/" = _depend2.tmp > obj/msvc/allp/makefile.dep > sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/msvc\/alleg_s\/\1\.obj:/" _depend2.tmp > obj/msvc/alleg_s/makefile.dep > sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/msvc\/alld_s\/\1\.obj:/" _depend2.tmp > obj/msvc/alld_s/makefile.dep > sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/msvc\/allp_s\/\1\.obj:/" _depend2.tmp > obj/msvc/allp_s/makefile.dep > rm _depend.tmp _depend2.tmp > else > sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/msvc\/alleg\/\1\.obj:/" = _depend2.tmp > obj\msvc\alleg\makefile.dep > sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/msvc\/alld\/\1\.obj:/" = _depend2.tmp > obj\msvc\alld\makefile.dep > sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/msvc\/allp\/\1\.obj:/" = _depend2.tmp > obj\msvc\allp\makefile.dep > sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/msvc\/alleg_s\/\1\.obj:/" _depend2.tmp > obj\msvc\alleg_s\makefile.dep > sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/msvc\/alld_s\/\1\.obj:/" _depend2.tmp > obj\msvc\alld_s\makefile.dep > sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/msvc\/allp_s\/\1\.obj:/" _depend2.tmp > obj\msvc\allp_s\makefile.dep > del _depend.tmp > del _depend2.tmp > endif > |