1 # Makefile for Microsoft Visual C++
\r
7 LINK = link.exe /nologo
\r
10 DEFINES = /DVER_REVISION=\"$(DOS2UNIX_VERSION)\" /DVER_DATE=\"$(DOS2UNIX_DATE)\"
\r
19 PROGRAMS = dos2unix.exe unix2dos.exe mac2unix.exe unix2mac.exe
\r
22 DOCFILES = man\man1\$(PACKAGE).txt man\man1\$(PACKAGE).$(HTMLEXT)
\r
23 VERSIONSUFFIX = -win32
\r
26 prefix = c:\usr\local
\r
28 # We only build and install the English manuals, because wildcards on
\r
29 # directory names are not supported in Windows CMD. Like man\*\man1\*.txt will
\r
30 # give a syntax error. It could be done with more scripting, but for simplicity
\r
31 # we stick to English.
\r
33 all: $(PROGRAMS) $(DOCFILES)
\r
36 dos2unix.exe: dos2unix.obj querycp.obj common.obj
\r
37 $(LINK) $(LDFLAGS) dos2unix.obj querycp.obj common.obj setargv.obj mpr.lib
\r
39 unix2dos.exe: unix2dos.obj querycp.obj common.obj
\r
40 $(LINK) $(LDFLAGS) unix2dos.obj querycp.obj common.obj setargv.obj mpr.lib
\r
44 CFLAGS = $(CFLAGS) -DD2U_UNICODE
\r
47 dos2unix.obj : $(SRCDIR)\dos2unix.c $(SRCDIR)\querycp.h $(SRCDIR)\common.h
\r
48 $(CC) -c $(CFLAGS) $(SRCDIR)\dos2unix.c
\r
50 unix2dos.obj : $(SRCDIR)\unix2dos.c $(SRCDIR)\querycp.h $(SRCDIR)\common.h
\r
51 $(CC) -c $(CFLAGS) $(SRCDIR)\unix2dos.c
\r
53 querycp.obj : $(SRCDIR)\querycp.c $(SRCDIR)\querycp.h
\r
54 $(CC) -c $(CFLAGS) $(SRCDIR)\querycp.c
\r
56 common.obj : $(SRCDIR)\common.c $(SRCDIR)\common.h
\r
57 $(CC) -c $(CFLAGS) $(SRCDIR)\common.c
\r
59 mac2unix.exe : dos2unix.exe
\r
60 copy /v dos2unix.exe mac2unix.exe
\r
62 unix2mac.exe : unix2dos.exe
\r
63 copy /v unix2dos.exe unix2mac.exe
\r
65 exec_prefix = $(prefix)
\r
66 bindir = $(exec_prefix)\bin
\r
67 datarootdir = $(prefix)\share
\r
68 datadir = $(datarootdir)
\r
70 docsubdir = $(PACKAGE)-$(DOS2UNIX_VERSION)
\r
72 docdir = $(datarootdir)\doc\$(docsubdir)
\r
73 INSTALL_OBJS_DOC = README.txt NEWS.txt ChangeLog.txt COPYING.txt TODO.txt BUGS.txt $(DOCFILES)
\r
77 if not exist $@ mkdir $@
\r
79 $(bindir): $(prefix)
\r
80 if not exist $@ mkdir $@
\r
82 $(datarootdir): $(prefix)
\r
83 if not exist $@ mkdir $@
\r
85 $(datarootdir)\doc: $(datarootdir)
\r
86 if not exist $@ mkdir $@
\r
88 $(docdir): $(datarootdir)\doc
\r
89 if not exist $@ mkdir $@
\r
91 install: $(PROGRAMS) $(DOCFILES) $(bindir) $(docdir)
\r
92 copy dos2unix.exe $(bindir)
\r
93 copy mac2unix.exe $(bindir)
\r
94 copy unix2dos.exe $(bindir)
\r
95 copy unix2mac.exe $(bindir)
\r
96 copy README.txt $(docdir)
\r
97 copy NEWS.txt $(docdir)
\r
98 copy ChangeLog.txt $(docdir)
\r
99 copy COPYING.txt $(docdir)
\r
100 copy TODO.txt $(docdir)
\r
101 copy BUGS.txt $(docdir)
\r
102 copy man\man1\$(PACKAGE).txt $(docdir)
\r
103 copy man\man1\$(PACKAGE).$(HTMLEXT) $(docdir)
\r
105 man\man1\dos2unix.txt : man\man1\dos2unix.pod
\r
108 man\man1\dos2unix.$(HTMLEXT) : man\man1\dos2unix.pod
\r
109 pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - DOS/MAC to UNIX and vice versa text file format converter" $** > $@
\r
111 TXTFILES = man\man1\$(PACKAGE).txt
\r
112 HTMLFILES = man\man1\$(PACKAGE).$(HTMLEXT)
\r
116 html : $(HTMLFILES)
\r
121 -del $(bindir)\dos2unix.exe
\r
122 -del $(bindir)\mac2unix.exe
\r
123 -del $(bindir)\unix2dos.exe
\r
124 -del $(bindir)\unix2mac.exe
\r
125 -rmdir /s /q $(docdir)
\r
127 !ifndef VERSIONSUFFIX
\r
128 VERSIONSUFFIX = -bin
\r
132 ZIPFILE = $(PACKAGE)$(DOS2UNIX_VERSION)$(VERSIONSUFFIX).zip
\r
134 ZIPOBJ = bin\dos2unix.exe bin\mac2unix.exe bin\unix2dos.exe bin\unix2mac.exe share\doc\$(docsubdir) $(ZIPOBJ_EXTRA)
\r
139 @echo cd /d $(prefix) > $(DISTCMD)
\r
140 @echo unix2dos -k share\doc\$(docsubdir)\*.txt >> $(DISTCMD)
\r
141 @echo unix2dos -k share\doc\$(docsubdir)\*.$(HTMLEXT) >> $(DISTCMD)
\r
142 @echo zip -r $(ZIPFILE) $(ZIPOBJ) >> $(DISTCMD)
\r
143 @echo cd /d $(MAKEDIR) >> $(DISTCMD)
\r
144 @echo move $(prefix)\$(ZIPFILE) .. >> $(DISTCMD)
\r
153 clean : mostlyclean
\r
156 maintainer-clean : clean
\r