From 23aa8a3221ebacf5891def22006b9850497437de Mon Sep 17 00:00:00 2001 From: PHO Date: Sat, 30 May 2009 12:14:30 +0900 Subject: [PATCH 1/1] Initial revision of the Blackboard DDNS. --- .gitignore | 5 ++++ GNUmakefile | 3 +++ Main.hs | 4 ++++ Setup.lhs | 3 +++ blackboard-ddns.cabal | 21 ++++++++++++++++ cabal-package.mk | 56 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 92 insertions(+) create mode 100644 .gitignore create mode 100644 GNUmakefile create mode 100644 Main.hs create mode 100644 Setup.lhs create mode 100644 blackboard-ddns.cabal create mode 100644 cabal-package.mk diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..30e9e85 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +dist +Setup + +*.o +*.hi diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..f258db0 --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,3 @@ +RUN_COMMAND = ./dist/build/blackboard-ddns/blackboard-ddns + +include cabal-package.mk diff --git a/Main.hs b/Main.hs new file mode 100644 index 0000000..d82a4bd --- /dev/null +++ b/Main.hs @@ -0,0 +1,4 @@ +module Main where + +main :: IO () +main = return () diff --git a/Setup.lhs b/Setup.lhs new file mode 100644 index 0000000..5bde0de --- /dev/null +++ b/Setup.lhs @@ -0,0 +1,3 @@ +#!/usr/bin/env runhaskell +> import Distribution.Simple +> main = defaultMain diff --git a/blackboard-ddns.cabal b/blackboard-ddns.cabal new file mode 100644 index 0000000..d30a78a --- /dev/null +++ b/blackboard-ddns.cabal @@ -0,0 +1,21 @@ +Name: blackboard-ddns +Version: 0.1 +Synopsis: +Description: +Category: Network +License: PublicDomain +Author: PHO +Maintainer: PHO +Stability: Experimental +Cabal-Version: >= 1.2 +Build-Type: Simple + +Executable blackboard-ddns + Build-Depends: + base, haskelldb + + Main-Is: + Main.hs + + GHC-Options: + -Wall diff --git a/cabal-package.mk b/cabal-package.mk new file mode 100644 index 0000000..a37d18e --- /dev/null +++ b/cabal-package.mk @@ -0,0 +1,56 @@ +# -*- makefile-gmake -*- +# +# Variables: +# +# CONFIGURE_ARGS :: arguments to be passed to ./Setup configure +# default: --disable-optimization +# +# RUN_COMMAND :: command to be run for "make run" +# + +GHC ?= ghc +FIND ?= find +RM_RF ?= rm -rf +SUDO ?= sudo + +SETUP_FILE ?= $(wildcard Setup.*hs) +CABAL_FILE ?= $(wildcard *.cabal) + +CONFIGURE_ARGS := --disable-optimization + +build: dist/setup-config Setup + ./Setup build + +ifeq ($(RUN_COMMAND),) +run: + @echo "cabal-package.mk: No command to run." + @echo "cabal-package.mk: If you want to run something, define RUN_COMMAND variable." +else +run: build + @echo ".:.:. Let's go .:.:." + $(RUN_COMMAND) +endif + +dist/setup-config: $(CABAL_FILE) Setup + ./Setup configure $(CONFIGURE_ARGS) + +Setup: $(SETUP_FILE) + $(GHC) --make Setup + +clean: + $(RM_RF) dist Setup *.o *.hi .setup-config *.buildinfo + $(FIND) . -name '*~' -exec rm -f {} \; + +doc: dist/setup-config Setup + ./Setup haddock + +install: build + $(SUDO) ./Setup install + +sdist: Setup + ./Setup sdist + +test: build + ./Setup test + +.PHONY: build run clean install doc sdist test -- 2.40.0