More stackup changes
[geda-pcb/pcjc2/v2.git] / win32 / pcb-win32-deps.mk
blob10e285f7689a48a79bd4da450e888a026e399cb2
1 # This makefile fragment is used to manage downloading, verifying, and when required
2 # building the required files for a cygwin build environment
4 # Normally called from build_pcb but can be run manually with:
5 # for glib:
7 # gmake -f pcb-win32-deps.mk DEPMK=setup/glib.mk <target>
9 include config.mk
10 include ${DEPMK}
12 ALL_DISTURLS= ${SRC_DISTURLS} ${DEV_DISTURLS} ${RUN_DISTURLS}
13 DISTINFO= ${CURDIR}/setup/${NAME}.distinfo
14 PROMPT= "PCB Dependencies Setup --\> "
16 .PHONY: check-dirs
17 check-dirs:
18 @test -d ${DISTDIR} || mkdir -p ${DISTDIR}
19 @test -d ${STAMPDIR} || mkdir -p ${STAMPDIR}
20 @test -d ${RUNTIMEDIR} || mkdir -p ${RUNTIMEDIR}
21 @test -d ${DEVTIMEDIR} || mkdir -p ${DEVTIMEDIR}
22 @test -d ${LIBSRCDIR} || mkdir -p ${LIBSRCDIR}
24 .PHONY: fetch
25 fetch: check-dirs
26 @${ECHO} "${PROMPT}Checking downloads for ${NAME}"
27 @for disturl in ${ALL_DISTURLS} ; do \
28 distfile=`${ECHO} $$disturl | ${SED} 's;.*/;;g'` ; \
29 if test ! -f ${DISTDIR}/$$distfile ; then \
30 ${ECHO} "${PROMPT}Attempting to download $$disturl" ; \
31 (cd ${DISTDIR} && ${WGET} $$disturl) || exit $$?; \
32 fi ; \
33 done
34 @${ECHO} "${PROMPT}Downloads complete for ${NAME}"
36 .PHONY: checksum
37 checksum: check-dirs
38 @${ECHO} "${PROMPT}Comparing checksums for ${NAME}"
39 @for disturl in ${ALL_DISTURLS} ; do \
40 distfile=`echo $$disturl | ${SED} 's;.*/;;g'` ; \
41 if test ! -f ${DISTDIR}/$$distfile ; then \
42 ${ECHO} "Missing distfile: ${DISTDIR}/$$distfile" ; \
43 exit 1 ; \
44 fi ; \
45 hash=`grep "\($$distfile\)" ${DISTINFO} | ${AWK} 'NF>1 { print $$NF }'` ; \
46 dlhash=`${OPENSSL} ${HASHTYPE} ${DISTDIR}/$$distfile | ${AWK} 'NF>1 {print $$NF}'` ; \
47 if test "$$hash" != "$$dlhash" ; then \
48 ${ECHO} "Checksum failure for $$distfile" ; \
49 ${ECHO} " computed: $$dlhash" ; \
50 ${ECHO} " expected: $$hash" ; \
51 exit 1 ; \
52 fi ; \
53 done
54 @${ECHO} "${PROMPT}All checksums match for ${NAME}"
56 .PHONY: makesum
57 makesum: check-dirs
58 @${ECHO} "${PROMPT}Recreating checksums for ${NAME}"
59 @${ECHO} "" > ${DISTINFO}.tmp
60 @for disturl in ${ALL_DISTURLS} ; do \
61 distfile=`echo $$disturl | ${SED} 's;.*/;;g'` ; \
62 if test ! -f ${DISTDIR}/$$distfile ; then \
63 ${ECHO} "Missing distfile: ${DISTDIR}/$$distfile" ; \
64 exit 1 ; \
65 fi ; \
66 ${ECHO} "Calculating hash for $${distfile}..." ; \
67 (cd ${DISTDIR} && ${OPENSSL} ${HASHTYPE} $$distfile >> ${DISTINFO}.tmp) ; \
68 done
69 @mv -f ${DISTINFO}.tmp ${DISTINFO}
70 @${ECHO} "${PROMPT}Recreated ${DISTINFO} for ${NAME}"
72 .PHONY: extract
73 extract: check-dirs
74 @${ECHO} "${PROMPT}Extracting runtime package for ${NAME}"
75 @for disturl in ${RUN_DISTURLS} ; do \
76 distfile=`echo $$disturl | ${SED} 's;.*/;;g'` ; \
77 if test ! -f ${DISTDIR}/$$distfile ; then \
78 ${ECHO} "Missing distfile: ${DISTDIR}/$$distfile" ; \
79 exit 1 ; \
80 fi ; \
81 (cd ${RUNTIMEDIR} && ${TOOLSDIR}/extract.sh ${DISTDIR}/$$distfile) ; \
82 done
83 @${ECHO} "${PROMPT}Extracting development package for ${NAME}"
84 @for disturl in ${DEV_DISTURLS} ; do \
85 distfile=`echo $$disturl | ${SED} 's;.*/;;g'` ; \
86 if test ! -f ${DISTDIR}/$$distfile ; then \
87 ${ECHO} "Missing distfile: ${DISTDIR}/$$distfile" ; \
88 exit 1 ; \
89 fi ; \
90 (cd ${DEVTIMEDIR} && ${TOOLSDIR}/extract.sh ${DISTDIR}/$$distfile) ; \
91 done
92 @${ECHO} "${PROMPT}Extracting src package for ${NAME}"
93 @for disturl in ${SRC_DISTURLS} ; do \
94 distfile=`echo $$disturl | ${SED} 's;.*/;;g'` ; \
95 if test ! -f ${DISTDIR}/$$distfile ; then \
96 ${ECHO} "Missing distfile: ${DISTDIR}/$$distfile" ; \
97 exit 1 ; \
98 fi ; \
99 (cd ${LIBSRCDIR} && ${TOOLSDIR}/extract.sh ${DISTDIR}/$$distfile) ; \
100 done
101 @${ECHO} "${PROMPT}Done extracting for ${NAME}"
104 .PHONY: show-license
105 show-license:
106 @${ECHO} "${LICENSE} ${NAME}-${VER}"
108 .PHONY: config-variables
109 config-variables:
110 @${ECHO} "gtk_win32_runtime=${RUNTIMEDIR}"
111 @${ECHO} "gtk_win32_devel=${DEVTIMEDIR}"
113 .PHONY: patch
114 patch:
115 echo "not implemented"
117 .PHONY: configure
118 configure:
119 echo "not implemented"
121 .PHONY: build
122 build:
123 echo "not implemented"
125 .PHONY: install
126 install:
127 echo "not implemented"