<commit_before>
module Makefile where 

import Text.PrettyPrint

import Prelude hiding(all)

($\$) t = ((t <> text "\n") $$)
tab = text "\t"
all = text "all"
clean = text "clean"
rm args = (text "rm -rf" <+> hsep args)
phony = text ".PHONY"
cc args = (text "$(CC)" <+> hsep args)
flags = text "$(FLAGS)"
target = text "$(TARGET)"
inc = text "$(INC)"
lib = text "$(LIB)"
deps = text "$(DEPS)"
dSYM = text ".dSYM"
i = (text "-I" <+>)
o = (text "-o" <+>)
parent = text ".."

generateMakefile :: [String] -> String -> String -> String -> String -> String -> Doc
generateMakefile classFiles progName compiler ccFlags incPath libs = 
    decl "CC" [compiler]
    $$
    decl "TARGET" [progName]
    $$
    decl "INC" [incPath]
    $$
    decl "LIB" [libs]
    $$
    decl "FLAGS" [ccFlags]
    $$
    decl "DEPS" ("shared.c" : classFiles)
    $\$
    rule all target
         empty
    $\$
    rule target deps
         (cc [flags, i inc, i parent, lib, deps, o target])
    $\$
    rule clean empty<commit_msg>Place archive files after object file in generated Makefile.<commit_after>
module Makefile where

import Text.PrettyPrint

import Prelude hiding(all)

($\$) t = ((t <> text "\n") $$)
tab = text "\t"
all = text "all"
clean = text "clean"
rm args = (text "rm -rf" <+> hsep args)
phony = text ".PHONY"
cc args = (text "$(CC)" <+> hsep args)
flags = text "$(FLAGS)"
target = text "$(TARGET)"
inc = text "$(INC)"
lib = text "$(LIB)"
deps = text "$(DEPS)"
dSYM = text ".dSYM"
i = (text "-I" <+>)
o = (text "-o" <+>)
parent = text ".."

generateMakefile :: [String] -> String -> String -> String -> String -> String -> Doc
generateMakefile classFiles progName compiler ccFlags incPath libs =
    decl "CC" [compiler]
    $$
    decl "TARGET" [progName]
    $$
    decl "INC" [incPath]
    $$
    decl "LIB" [libs]
    $$
    decl "FLAGS" [ccFlags]
    $$
    decl "DEPS" ("shared.c" : classFiles)
    $\$
    rule all target
         empty
    $\$
    rule target deps
         (cc [flags, i inc, i parent, lib, deps, lib, lib, o target])
    $\$
    rule clean empty
{'fraction_non_alphanumeric': 0.18256658595641648, 'fraction_numerical': 0.0, 'mean_word_length': 2.7427536231884058, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '474499', 'n_tokens_mistral': 752, 'n_tokens_neox': 721, 'n_words': 245}