Fossil SCM
make PellesC-Makefile dynamic, only special files (util, zlib th, sqlite are mentioned explicitly, other sources are read by wildcard expansion
Commit
3bb1f957a928179dd613d62b3f1bdfa5e965098a
Parent
f52c6f688618b6f…
1 file changed
+56
-15
+56
-15
| --- win/Makefile.PellesCGMake | ||
| +++ win/Makefile.PellesCGMake | ||
| @@ -44,77 +44,111 @@ | ||
| 44 | 44 | TARGETMACHINE_CC=x86 |
| 45 | 45 | TARGETMACHINE_LN=ix86 |
| 46 | 46 | TARGETEXTEND= |
| 47 | 47 | endif |
| 48 | 48 | |
| 49 | +# define the project directories | |
| 49 | 50 | B=.. |
| 50 | 51 | SRCDIR=$(B)/src/ |
| 51 | 52 | WINDIR=$(B)/win/ |
| 52 | 53 | ZLIBSRCDIR=../../zlib/ |
| 53 | 54 | |
| 55 | +# define linker command and options | |
| 54 | 56 | LINK=$(PellesCDir)/bin/polink.exe |
| 55 | 57 | LINKFLAGS=-subsystem:console -machine:$(TARGETMACHINE_LN) /LIBPATH:$(PellesCDir)\lib\win$(TARGETEXTEND) /LIBPATH:$(PellesCDir)\lib kernel32.lib advapi32.lib delayimp$(TARGETEXTEND).lib Wsock32.lib Crtmt$(TARGETEXTEND).lib |
| 56 | 58 | |
| 59 | +# define standard C-compiler and flags, used to compile | |
| 60 | +# the fossil binary. Some special definitions follow for | |
| 61 | +# special files follow | |
| 57 | 62 | CC=$(PellesCDir)\bin\pocc.exe |
| 58 | 63 | DEFINES=-DFOSSIL_I18N=0 -Dstrncasecmp=memicmp -Dstrcasecmp=stricmp |
| 59 | 64 | CCFLAGS=-T$(TARGETMACHINE_CC)-coff -Ot -W2 -Gd -Go -Ze -MT $(DEFINES) |
| 60 | 65 | INCLUDE=/I $(PellesCDir)\Include\Win /I $(PellesCDir)\Include /I $(ZLIBSRCDIR) /I $(SRCDIR) |
| 61 | 66 | |
| 67 | +# define commands for building the windows resource files | |
| 62 | 68 | RESOURCE=fossil.res |
| 63 | 69 | RC=$(PellesCDir)\bin\porc.exe |
| 64 | 70 | RCFLAGS=$(INCLUDE) -D__POCC__=1 -D_M_X$(TARGETVERSION) |
| 65 | 71 | |
| 72 | +# define the special utilities files, needed to generate | |
| 73 | +# the automatically generated source files | |
| 66 | 74 | UTILS=translate.exe mkindex.exe makeheaders.exe |
| 67 | 75 | UTILS_OBJ=$(UTILS:.exe=.obj) |
| 76 | +UTILS_SRC=$(foreach uf,$(UTILS),$(SRCDIR)$(uf:.exe=.c)) | |
| 68 | 77 | |
| 69 | -SRC=add.c allrepo.c attach.c bag.c blob.c branch.c browse.c captcha.c cgi.c checkin.c checkout.c clearsign.c clone.c comformat.c configure.c content.c db.c delta.c deltacmd.c descendants.c diff.c diffcmd.c doc.c encode.c file.c finfo.c graph.c http.c http_socket.c http_ssl.c http_transport.c info.c login.c main.c manifest.c md5.c merge.c merge3.c name.c pivot.c popen.c pqueue.c printf.c rebuild.c report.c rss.c schema.c search.c setup.c sha1.c shun.c skins.c stat.c style.c sync.c tag.c th_main.c timeline.c tkt.c tktsetup.c undo.c update.c url.c user.c verify.c vfile.c wiki.c wikiformat.c winhttp.c xfer.c zip.c | |
| 70 | -ORIGSRC=$(foreach sf,$(SRC),$(SRCDIR)$(sf)) | |
| 71 | -TRANSLATEDSRC=$(SRC:.c=_.c) | |
| 72 | -TRANSLATEDOBJ=$(TRANSLATEDSRC:.c=.obj) | |
| 73 | - | |
| 78 | +# define the sqlite files, which need special flags on compile | |
| 74 | 79 | SQLITESRC=sqlite3.c |
| 75 | 80 | ORIGSQLITESRC=$(foreach sf,$(SQLITESRC),$(SRCDIR)$(sf)) |
| 76 | 81 | SQLITEOBJ=$(foreach sf,$(SQLITESRC),$(sf:.c=.obj)) |
| 77 | 82 | SQLITEDEFINES=-DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 |
| 78 | 83 | |
| 84 | +# define the th scripting files, which need special flags on compile | |
| 79 | 85 | THSRC=th.c th_lang.c |
| 80 | 86 | ORIGTHSRC=$(foreach sf,$(THSRC),$(SRCDIR)$(sf)) |
| 81 | 87 | THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj)) |
| 82 | 88 | |
| 89 | +# define the zlib files, needed by this compile | |
| 83 | 90 | ZLIBSRC=adler32.c compress.c crc32.c deflate.c gzclose.c gzlib.c gzread.c gzwrite.c infback.c inffast.c inflate.c inftrees.c trees.c uncompr.c zutil.c |
| 84 | 91 | ORIGZLIBSRC=$(foreach sf,$(ZLIBSRC),$(ZLIBSRCDIR)$(sf)) |
| 85 | 92 | ZLIBOBJ=$(foreach sf,$(ZLIBSRC),$(sf:.c=.obj)) |
| 86 | 93 | |
| 94 | +# define all fossil sources, using the standard compile and | |
| 95 | +# source generation. These are all files in SRCDIR, which are not | |
| 96 | +# mentioned as special files above: | |
| 97 | +ORIGSRC=$(filter-out $(UTILS_SRC) $(ORIGTHSRC) $(ORIGSQLITESRC),$(wildcard $(SRCDIR)*.c)) | |
| 98 | +SRC=$(subst $(SRCDIR),,$(ORIGSRC)) | |
| 99 | +TRANSLATEDSRC=$(SRC:.c=_.c) | |
| 100 | +TRANSLATEDOBJ=$(TRANSLATEDSRC:.c=.obj) | |
| 101 | + | |
| 102 | +# main target file is the application | |
| 87 | 103 | APPLICATION=fossil.exe |
| 88 | 104 | |
| 105 | +# ########################################################################### | |
| 106 | +# define the standard make target | |
| 89 | 107 | .PHONY: default |
| 90 | 108 | default: page_index.h headers $(APPLICATION) |
| 91 | 109 | |
| 92 | -$(UTILS): %.exe: %.obj | |
| 110 | +# ########################################################################### | |
| 111 | +# symbolic target to generate the source generate utils | |
| 112 | +.PHONY: utils | |
| 113 | +utils: $(UTILS) | |
| 114 | + | |
| 115 | +# link utils | |
| 116 | +$(UTILS) version.exe: %.exe: %.obj | |
| 93 | 117 | $(LINK) $(LINKFLAGS) -out:"$@" $< |
| 94 | 118 | |
| 119 | +# compiling standard fossil utils | |
| 95 | 120 | $(UTILS_OBJ): %.obj: $(SRCDIR)%.c |
| 96 | 121 | $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@" |
| 97 | 122 | |
| 98 | -$(TRANSLATEDSRC): %_.c: $(SRCDIR)%.c translate.exe | |
| 99 | - translate.exe $< >$@ | |
| 100 | - | |
| 101 | -page_index.h: $(TRANSLATEDSRC) mkindex.exe | |
| 102 | - mkindex.exe $(TRANSLATEDSRC) >$@ | |
| 103 | - | |
| 104 | -version.exe: version.obj | |
| 105 | - $(LINK) $(LINKFLAGS) -out:"$@" $< | |
| 106 | - | |
| 123 | +# compile special windows utils | |
| 107 | 124 | version.obj: $(WINDIR)version.c |
| 108 | 125 | $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@" |
| 109 | 126 | |
| 127 | +# ########################################################################### | |
| 128 | +# generate the translated c-source files | |
| 129 | +$(TRANSLATEDSRC): %_.c: $(SRCDIR)%.c translate.exe | |
| 130 | + translate.exe $< >$@ | |
| 131 | + | |
| 132 | +# ########################################################################### | |
| 133 | +# generate the index source, containing all web references,.. | |
| 134 | +page_index.h: $(TRANSLATEDSRC) mkindex.exe | |
| 135 | + mkindex.exe $(TRANSLATEDSRC) >$@ | |
| 136 | + | |
| 137 | +# ########################################################################### | |
| 138 | +# extracting version info from manifest | |
| 110 | 139 | VERSION.h: version.exe ..\manifest.uuid ..\manifest |
| 111 | 140 | version.exe ..\manifest.uuid ..\manifest > $@ |
| 112 | 141 | |
| 142 | +# ########################################################################### | |
| 143 | +# generate the simplified headers | |
| 113 | 144 | headers: makeheaders.exe page_index.h VERSION.h ../src/sqlite3.h ../src/th.h VERSION.h |
| 114 | 145 | makeheaders.exe $(foreach ts,$(TRANSLATEDSRC),$(ts):$(ts:_.c=.h)) ../src/sqlite3.h ../src/th.h VERSION.h |
| 115 | 146 | echo Done >$@ |
| 147 | + | |
| 148 | +# ########################################################################### | |
| 149 | +# compile C sources with relevant options | |
| 116 | 150 | |
| 117 | 151 | $(TRANSLATEDOBJ): %_.obj: %_.c %.h |
| 118 | 152 | $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@" |
| 119 | 153 | |
| 120 | 154 | $(SQLITEOBJ): %.obj: $(SRCDIR)%.c $(SRCDIR)%.h |
| @@ -124,15 +158,22 @@ | ||
| 124 | 158 | $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@" |
| 125 | 159 | |
| 126 | 160 | $(ZLIBOBJ): %.obj: $(ZLIBSRCDIR)%.c |
| 127 | 161 | $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@" |
| 128 | 162 | |
| 163 | +# ########################################################################### | |
| 164 | +# create the windows resource with icon and version info | |
| 129 | 165 | $(RESOURCE): %.res: ../win/%.rc ../win/*.ico |
| 130 | 166 | $(RC) $(RCFLAGS) $< -Fo"$@" |
| 131 | 167 | |
| 168 | +# ########################################################################### | |
| 169 | +# link the application | |
| 132 | 170 | $(APPLICATION): $(TRANSLATEDOBJ) $(SQLITEOBJ) $(THOBJ) $(ZLIBOBJ) headers $(RESOURCE) |
| 133 | 171 | $(LINK) $(LINKFLAGS) -out:"$@" $(TRANSLATEDOBJ) $(SQLITEOBJ) $(THOBJ) $(ZLIBOBJ) $(RESOURCE) |
| 172 | + | |
| 173 | +# ########################################################################### | |
| 174 | +# cleanup | |
| 134 | 175 | |
| 135 | 176 | .PHONY: clean |
| 136 | 177 | clean: |
| 137 | 178 | del /F $(TRANSLATEDOBJ) $(SQLITEOBJ) $(THOBJ) $(ZLIBOBJ) $(UTILS_OBJ) version.obj |
| 138 | 179 | del /F $(TRANSLATEDSRC) |
| 139 | 180 |
| --- win/Makefile.PellesCGMake | |
| +++ win/Makefile.PellesCGMake | |
| @@ -44,77 +44,111 @@ | |
| 44 | TARGETMACHINE_CC=x86 |
| 45 | TARGETMACHINE_LN=ix86 |
| 46 | TARGETEXTEND= |
| 47 | endif |
| 48 | |
| 49 | B=.. |
| 50 | SRCDIR=$(B)/src/ |
| 51 | WINDIR=$(B)/win/ |
| 52 | ZLIBSRCDIR=../../zlib/ |
| 53 | |
| 54 | LINK=$(PellesCDir)/bin/polink.exe |
| 55 | LINKFLAGS=-subsystem:console -machine:$(TARGETMACHINE_LN) /LIBPATH:$(PellesCDir)\lib\win$(TARGETEXTEND) /LIBPATH:$(PellesCDir)\lib kernel32.lib advapi32.lib delayimp$(TARGETEXTEND).lib Wsock32.lib Crtmt$(TARGETEXTEND).lib |
| 56 | |
| 57 | CC=$(PellesCDir)\bin\pocc.exe |
| 58 | DEFINES=-DFOSSIL_I18N=0 -Dstrncasecmp=memicmp -Dstrcasecmp=stricmp |
| 59 | CCFLAGS=-T$(TARGETMACHINE_CC)-coff -Ot -W2 -Gd -Go -Ze -MT $(DEFINES) |
| 60 | INCLUDE=/I $(PellesCDir)\Include\Win /I $(PellesCDir)\Include /I $(ZLIBSRCDIR) /I $(SRCDIR) |
| 61 | |
| 62 | RESOURCE=fossil.res |
| 63 | RC=$(PellesCDir)\bin\porc.exe |
| 64 | RCFLAGS=$(INCLUDE) -D__POCC__=1 -D_M_X$(TARGETVERSION) |
| 65 | |
| 66 | UTILS=translate.exe mkindex.exe makeheaders.exe |
| 67 | UTILS_OBJ=$(UTILS:.exe=.obj) |
| 68 | |
| 69 | SRC=add.c allrepo.c attach.c bag.c blob.c branch.c browse.c captcha.c cgi.c checkin.c checkout.c clearsign.c clone.c comformat.c configure.c content.c db.c delta.c deltacmd.c descendants.c diff.c diffcmd.c doc.c encode.c file.c finfo.c graph.c http.c http_socket.c http_ssl.c http_transport.c info.c login.c main.c manifest.c md5.c merge.c merge3.c name.c pivot.c popen.c pqueue.c printf.c rebuild.c report.c rss.c schema.c search.c setup.c sha1.c shun.c skins.c stat.c style.c sync.c tag.c th_main.c timeline.c tkt.c tktsetup.c undo.c update.c url.c user.c verify.c vfile.c wiki.c wikiformat.c winhttp.c xfer.c zip.c |
| 70 | ORIGSRC=$(foreach sf,$(SRC),$(SRCDIR)$(sf)) |
| 71 | TRANSLATEDSRC=$(SRC:.c=_.c) |
| 72 | TRANSLATEDOBJ=$(TRANSLATEDSRC:.c=.obj) |
| 73 | |
| 74 | SQLITESRC=sqlite3.c |
| 75 | ORIGSQLITESRC=$(foreach sf,$(SQLITESRC),$(SRCDIR)$(sf)) |
| 76 | SQLITEOBJ=$(foreach sf,$(SQLITESRC),$(sf:.c=.obj)) |
| 77 | SQLITEDEFINES=-DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 |
| 78 | |
| 79 | THSRC=th.c th_lang.c |
| 80 | ORIGTHSRC=$(foreach sf,$(THSRC),$(SRCDIR)$(sf)) |
| 81 | THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj)) |
| 82 | |
| 83 | ZLIBSRC=adler32.c compress.c crc32.c deflate.c gzclose.c gzlib.c gzread.c gzwrite.c infback.c inffast.c inflate.c inftrees.c trees.c uncompr.c zutil.c |
| 84 | ORIGZLIBSRC=$(foreach sf,$(ZLIBSRC),$(ZLIBSRCDIR)$(sf)) |
| 85 | ZLIBOBJ=$(foreach sf,$(ZLIBSRC),$(sf:.c=.obj)) |
| 86 | |
| 87 | APPLICATION=fossil.exe |
| 88 | |
| 89 | .PHONY: default |
| 90 | default: page_index.h headers $(APPLICATION) |
| 91 | |
| 92 | $(UTILS): %.exe: %.obj |
| 93 | $(LINK) $(LINKFLAGS) -out:"$@" $< |
| 94 | |
| 95 | $(UTILS_OBJ): %.obj: $(SRCDIR)%.c |
| 96 | $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@" |
| 97 | |
| 98 | $(TRANSLATEDSRC): %_.c: $(SRCDIR)%.c translate.exe |
| 99 | translate.exe $< >$@ |
| 100 | |
| 101 | page_index.h: $(TRANSLATEDSRC) mkindex.exe |
| 102 | mkindex.exe $(TRANSLATEDSRC) >$@ |
| 103 | |
| 104 | version.exe: version.obj |
| 105 | $(LINK) $(LINKFLAGS) -out:"$@" $< |
| 106 | |
| 107 | version.obj: $(WINDIR)version.c |
| 108 | $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@" |
| 109 | |
| 110 | VERSION.h: version.exe ..\manifest.uuid ..\manifest |
| 111 | version.exe ..\manifest.uuid ..\manifest > $@ |
| 112 | |
| 113 | headers: makeheaders.exe page_index.h VERSION.h ../src/sqlite3.h ../src/th.h VERSION.h |
| 114 | makeheaders.exe $(foreach ts,$(TRANSLATEDSRC),$(ts):$(ts:_.c=.h)) ../src/sqlite3.h ../src/th.h VERSION.h |
| 115 | echo Done >$@ |
| 116 | |
| 117 | $(TRANSLATEDOBJ): %_.obj: %_.c %.h |
| 118 | $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@" |
| 119 | |
| 120 | $(SQLITEOBJ): %.obj: $(SRCDIR)%.c $(SRCDIR)%.h |
| @@ -124,15 +158,22 @@ | |
| 124 | $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@" |
| 125 | |
| 126 | $(ZLIBOBJ): %.obj: $(ZLIBSRCDIR)%.c |
| 127 | $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@" |
| 128 | |
| 129 | $(RESOURCE): %.res: ../win/%.rc ../win/*.ico |
| 130 | $(RC) $(RCFLAGS) $< -Fo"$@" |
| 131 | |
| 132 | $(APPLICATION): $(TRANSLATEDOBJ) $(SQLITEOBJ) $(THOBJ) $(ZLIBOBJ) headers $(RESOURCE) |
| 133 | $(LINK) $(LINKFLAGS) -out:"$@" $(TRANSLATEDOBJ) $(SQLITEOBJ) $(THOBJ) $(ZLIBOBJ) $(RESOURCE) |
| 134 | |
| 135 | .PHONY: clean |
| 136 | clean: |
| 137 | del /F $(TRANSLATEDOBJ) $(SQLITEOBJ) $(THOBJ) $(ZLIBOBJ) $(UTILS_OBJ) version.obj |
| 138 | del /F $(TRANSLATEDSRC) |
| 139 |
| --- win/Makefile.PellesCGMake | |
| +++ win/Makefile.PellesCGMake | |
| @@ -44,77 +44,111 @@ | |
| 44 | TARGETMACHINE_CC=x86 |
| 45 | TARGETMACHINE_LN=ix86 |
| 46 | TARGETEXTEND= |
| 47 | endif |
| 48 | |
| 49 | # define the project directories |
| 50 | B=.. |
| 51 | SRCDIR=$(B)/src/ |
| 52 | WINDIR=$(B)/win/ |
| 53 | ZLIBSRCDIR=../../zlib/ |
| 54 | |
| 55 | # define linker command and options |
| 56 | LINK=$(PellesCDir)/bin/polink.exe |
| 57 | LINKFLAGS=-subsystem:console -machine:$(TARGETMACHINE_LN) /LIBPATH:$(PellesCDir)\lib\win$(TARGETEXTEND) /LIBPATH:$(PellesCDir)\lib kernel32.lib advapi32.lib delayimp$(TARGETEXTEND).lib Wsock32.lib Crtmt$(TARGETEXTEND).lib |
| 58 | |
| 59 | # define standard C-compiler and flags, used to compile |
| 60 | # the fossil binary. Some special definitions follow for |
| 61 | # special files follow |
| 62 | CC=$(PellesCDir)\bin\pocc.exe |
| 63 | DEFINES=-DFOSSIL_I18N=0 -Dstrncasecmp=memicmp -Dstrcasecmp=stricmp |
| 64 | CCFLAGS=-T$(TARGETMACHINE_CC)-coff -Ot -W2 -Gd -Go -Ze -MT $(DEFINES) |
| 65 | INCLUDE=/I $(PellesCDir)\Include\Win /I $(PellesCDir)\Include /I $(ZLIBSRCDIR) /I $(SRCDIR) |
| 66 | |
| 67 | # define commands for building the windows resource files |
| 68 | RESOURCE=fossil.res |
| 69 | RC=$(PellesCDir)\bin\porc.exe |
| 70 | RCFLAGS=$(INCLUDE) -D__POCC__=1 -D_M_X$(TARGETVERSION) |
| 71 | |
| 72 | # define the special utilities files, needed to generate |
| 73 | # the automatically generated source files |
| 74 | UTILS=translate.exe mkindex.exe makeheaders.exe |
| 75 | UTILS_OBJ=$(UTILS:.exe=.obj) |
| 76 | UTILS_SRC=$(foreach uf,$(UTILS),$(SRCDIR)$(uf:.exe=.c)) |
| 77 | |
| 78 | # define the sqlite files, which need special flags on compile |
| 79 | SQLITESRC=sqlite3.c |
| 80 | ORIGSQLITESRC=$(foreach sf,$(SQLITESRC),$(SRCDIR)$(sf)) |
| 81 | SQLITEOBJ=$(foreach sf,$(SQLITESRC),$(sf:.c=.obj)) |
| 82 | SQLITEDEFINES=-DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 |
| 83 | |
| 84 | # define the th scripting files, which need special flags on compile |
| 85 | THSRC=th.c th_lang.c |
| 86 | ORIGTHSRC=$(foreach sf,$(THSRC),$(SRCDIR)$(sf)) |
| 87 | THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj)) |
| 88 | |
| 89 | # define the zlib files, needed by this compile |
| 90 | ZLIBSRC=adler32.c compress.c crc32.c deflate.c gzclose.c gzlib.c gzread.c gzwrite.c infback.c inffast.c inflate.c inftrees.c trees.c uncompr.c zutil.c |
| 91 | ORIGZLIBSRC=$(foreach sf,$(ZLIBSRC),$(ZLIBSRCDIR)$(sf)) |
| 92 | ZLIBOBJ=$(foreach sf,$(ZLIBSRC),$(sf:.c=.obj)) |
| 93 | |
| 94 | # define all fossil sources, using the standard compile and |
| 95 | # source generation. These are all files in SRCDIR, which are not |
| 96 | # mentioned as special files above: |
| 97 | ORIGSRC=$(filter-out $(UTILS_SRC) $(ORIGTHSRC) $(ORIGSQLITESRC),$(wildcard $(SRCDIR)*.c)) |
| 98 | SRC=$(subst $(SRCDIR),,$(ORIGSRC)) |
| 99 | TRANSLATEDSRC=$(SRC:.c=_.c) |
| 100 | TRANSLATEDOBJ=$(TRANSLATEDSRC:.c=.obj) |
| 101 | |
| 102 | # main target file is the application |
| 103 | APPLICATION=fossil.exe |
| 104 | |
| 105 | # ########################################################################### |
| 106 | # define the standard make target |
| 107 | .PHONY: default |
| 108 | default: page_index.h headers $(APPLICATION) |
| 109 | |
| 110 | # ########################################################################### |
| 111 | # symbolic target to generate the source generate utils |
| 112 | .PHONY: utils |
| 113 | utils: $(UTILS) |
| 114 | |
| 115 | # link utils |
| 116 | $(UTILS) version.exe: %.exe: %.obj |
| 117 | $(LINK) $(LINKFLAGS) -out:"$@" $< |
| 118 | |
| 119 | # compiling standard fossil utils |
| 120 | $(UTILS_OBJ): %.obj: $(SRCDIR)%.c |
| 121 | $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@" |
| 122 | |
| 123 | # compile special windows utils |
| 124 | version.obj: $(WINDIR)version.c |
| 125 | $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@" |
| 126 | |
| 127 | # ########################################################################### |
| 128 | # generate the translated c-source files |
| 129 | $(TRANSLATEDSRC): %_.c: $(SRCDIR)%.c translate.exe |
| 130 | translate.exe $< >$@ |
| 131 | |
| 132 | # ########################################################################### |
| 133 | # generate the index source, containing all web references,.. |
| 134 | page_index.h: $(TRANSLATEDSRC) mkindex.exe |
| 135 | mkindex.exe $(TRANSLATEDSRC) >$@ |
| 136 | |
| 137 | # ########################################################################### |
| 138 | # extracting version info from manifest |
| 139 | VERSION.h: version.exe ..\manifest.uuid ..\manifest |
| 140 | version.exe ..\manifest.uuid ..\manifest > $@ |
| 141 | |
| 142 | # ########################################################################### |
| 143 | # generate the simplified headers |
| 144 | headers: makeheaders.exe page_index.h VERSION.h ../src/sqlite3.h ../src/th.h VERSION.h |
| 145 | makeheaders.exe $(foreach ts,$(TRANSLATEDSRC),$(ts):$(ts:_.c=.h)) ../src/sqlite3.h ../src/th.h VERSION.h |
| 146 | echo Done >$@ |
| 147 | |
| 148 | # ########################################################################### |
| 149 | # compile C sources with relevant options |
| 150 | |
| 151 | $(TRANSLATEDOBJ): %_.obj: %_.c %.h |
| 152 | $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@" |
| 153 | |
| 154 | $(SQLITEOBJ): %.obj: $(SRCDIR)%.c $(SRCDIR)%.h |
| @@ -124,15 +158,22 @@ | |
| 158 | $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@" |
| 159 | |
| 160 | $(ZLIBOBJ): %.obj: $(ZLIBSRCDIR)%.c |
| 161 | $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@" |
| 162 | |
| 163 | # ########################################################################### |
| 164 | # create the windows resource with icon and version info |
| 165 | $(RESOURCE): %.res: ../win/%.rc ../win/*.ico |
| 166 | $(RC) $(RCFLAGS) $< -Fo"$@" |
| 167 | |
| 168 | # ########################################################################### |
| 169 | # link the application |
| 170 | $(APPLICATION): $(TRANSLATEDOBJ) $(SQLITEOBJ) $(THOBJ) $(ZLIBOBJ) headers $(RESOURCE) |
| 171 | $(LINK) $(LINKFLAGS) -out:"$@" $(TRANSLATEDOBJ) $(SQLITEOBJ) $(THOBJ) $(ZLIBOBJ) $(RESOURCE) |
| 172 | |
| 173 | # ########################################################################### |
| 174 | # cleanup |
| 175 | |
| 176 | .PHONY: clean |
| 177 | clean: |
| 178 | del /F $(TRANSLATEDOBJ) $(SQLITEOBJ) $(THOBJ) $(ZLIBOBJ) $(UTILS_OBJ) version.obj |
| 179 | del /F $(TRANSLATEDSRC) |
| 180 |