@@ -207,19 +207,19 @@ make MakeActions{..} ms = do
207 -- MVars for the module's dependencies.
207 -- MVars for the module's dependencies.
208 mexterns <- fmap unzip . sequence <$> mapM (readMVar . fst . fromMaybe (error "make: no barrier") . flip lookup barriers) deps
208 mexterns <- fmap unzip . sequence <$> mapM (readMVar . fst . fromMaybe (error "make: no barrier") . flip lookup barriers) deps
211+ Just (_, externs) -> do
210− outputTimestamp <- getOutputTimestamp moduleName
212+ outputTimestamp <- getOutputTimestamp moduleName
211− dependencyTimestamp <- maximumMaybe <$> mapM (fmap shouldExist . getOutputTimestamp) deps
213+ dependencyTimestamp <- maximumMaybe <$> mapM (fmap shouldExist . getOutputTimestamp) deps
212− inputTimestamp <- getInputTimestamp moduleName
214+ inputTimestamp <- getInputTimestamp moduleName
214− let shouldRebuild = case (inputTimestamp, dependencyTimestamp, outputTimestamp) of
216+ let shouldRebuild = case (inputTimestamp, dependencyTimestamp, outputTimestamp) of
215− (Right (Just t1), Just t3, Just t2) -> t1 > t2 || t3 > t2
217+ (Right (Just t1), Just t3, Just t2) -> t1 > t2 || t3 > t2
216− (Right (Just t1), Nothing, Just t2) -> t1 > t2
218+ (Right (Just t1), Nothing, Just t2) -> t1 > t2
217− (Left RebuildNever, _, Just _) -> False
219+ (Left RebuildNever, _, Just _) -> False
218− _ -> True
220+ _ -> True
220− let rebuild =
222+ let rebuild = do
222− Just (_, externs) -> do
223 (exts, warnings) <- listen $ do
223 (exts, warnings) <- listen $ do
224 progress $ CompilingModule moduleName
224 progress $ CompilingModule moduleName
225 let env = foldl' (flip applyExternsFileToEnvironment) initEnvironment externs
225 let env = foldl' (flip applyExternsFileToEnvironment) initEnvironment externs
@@ -235,15 +235,15 @@ make MakeActions{..} ms = do
235 evalSupplyT nextVar $ codegen renamed env' $ encode exts
235 evalSupplyT nextVar $ codegen renamed env' $ encode exts
236 return exts
236 return exts
237 markComplete (Just (warnings, exts)) Nothing
237 markComplete (Just (warnings, exts)) Nothing
238− Nothing -> markComplete Nothing Nothing
238+
240− if shouldRebuild
239+ if shouldRebuild
241− then rebuild
240+ then rebuild
243− mexts <- decodeExterns . snd <$> readExterns moduleName
242+ mexts <- decodeExterns . snd <$> readExterns moduleName
244− case mexts of
243+ case mexts of
245− Just exts -> markComplete (Just (mempty, exts)) Nothing
244+ Just exts -> markComplete (Just (mempty, exts)) Nothing
246− Nothing -> rebuild
245+ Nothing -> rebuild
246+ Nothing -> markComplete Nothing Nothing
248 markComplete :: Maybe (MultipleErrors, ExternsFile) -> Maybe MultipleErrors -> m ()
248 markComplete :: Maybe (MultipleErrors, ExternsFile) -> Maybe MultipleErrors -> m ()
249 markComplete externs errors = do
249 markComplete externs errors = do