summaryrefslogtreecommitdiff
path: root/utils/unlit
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2009-04-26 11:42:15 +0000
committerIan Lynagh <igloo@earth.li>2009-04-26 11:42:15 +0000
commit34cc75e1a62638f2833815746ebce0a9114dc26b (patch)
treeef21e8fd7af1356beea9cce7d6efb8a65374e24c /utils/unlit
parent74e1368d4688ee16f6decdf2cd3ebe27506b26ba (diff)
downloadhaskell-34cc75e1a62638f2833815746ebce0a9114dc26b.tar.gz
GHC new build system megapatch
Diffstat (limited to 'utils/unlit')
-rw-r--r--utils/unlit/Makefile28
-rw-r--r--utils/unlit/ghc.mk9
-rw-r--r--utils/unlit/unlit.c24
3 files changed, 21 insertions, 40 deletions
diff --git a/utils/unlit/Makefile b/utils/unlit/Makefile
index 1723a08e26..b5ecc2dd47 100644
--- a/utils/unlit/Makefile
+++ b/utils/unlit/Makefile
@@ -1,25 +1,3 @@
-TOP=../..
-include $(TOP)/mk/boilerplate.mk
-
-# Exclude for booting
-ifeq "$(stage)" "2"
-SRC_CC_OPTS += $(MACOSX_DEPLOYMENT_CC_OPTS)
-SRC_LD_OPTS += $(MACOSX_DEPLOYMENT_LD_OPTS)
-endif
-
-C_SRCS=unlit.c
-C_PROG=unlit
-SRC_CC_OPTS += -O
-
-# Get it over with!
-boot :: all
-
-#
-# Install unlit in lib/
-#
-INSTALL_LIBEXECS += $(C_PROG)
-
-BINDIST_EXTRAS += $(C_PROG)
-include $(TOP)/mk/bindist.mk
-
-include $(TOP)/mk/target.mk
+dir = utils/unlit
+TOP = ../..
+include $(TOP)/mk/sub-makefile.mk
diff --git a/utils/unlit/ghc.mk b/utils/unlit/ghc.mk
new file mode 100644
index 0000000000..458092543d
--- /dev/null
+++ b/utils/unlit/ghc.mk
@@ -0,0 +1,9 @@
+utils/unlit_dist_C_SRCS = unlit.c
+utils/unlit_dist_PROG = $(GHC_UNLIT_PGM)
+utils/unlit_dist_LIBEXEC = YES
+utils/unlit_dist_INSTALL = YES
+
+ifneq "$(BINDIST)" "YES"
+$(eval $(call build-prog,utils/unlit,dist,0))
+endif
+
diff --git a/utils/unlit/unlit.c b/utils/unlit/unlit.c
index c5beeb1cbf..1269b81463 100644
--- a/utils/unlit/unlit.c
+++ b/utils/unlit/unlit.c
@@ -90,10 +90,8 @@ static char *ofilename = NULL;
* if noisy is not set.
*/
-complain(file, lin, what)
-char *file;
-char *what;
-int lin; {
+void complain(char *file, int lin, char *what)
+{
if (noisy) {
if (file)
fprintf(stderr, "%s ", file);
@@ -102,7 +100,7 @@ int lin; {
}
}
-writeerror()
+void writeerror(void)
{
if (!strcmp(ofilename,"-")) {
fprintf(stderr, CANNOTWRITESTDOUT);
@@ -112,9 +110,8 @@ writeerror()
exit(1);
}
-myputc(c, ostream)
-char c;
-FILE *ostream; {
+void myputc(char c, FILE *ostream)
+{
if (putc(c,ostream) == EOF) {
writeerror();
}
@@ -247,10 +244,8 @@ FILE *istream, *ostream; {
* - there should be at least one DEFN line in a script.
*/
-unlit(file, istream, ostream)
-char *file;
-FILE *istream;
-FILE *ostream; {
+void unlit(char *file, FILE *istream, FILE *ostream)
+{
line last, this=START;
int linesread=0;
int defnsread=0;
@@ -317,9 +312,8 @@ FILE *ostream; {
* position to specify the standard input or the standard output respectively.
*/
-main(argc,argv)
-int argc;
-char **argv; {
+int main(int argc,char **argv)
+{
FILE *istream, *ostream;
char *file;