Permalink
Browse files

Converting to waf

  • Loading branch information...
1 parent ded5c67 commit 7bc842714ae9142f4ea125003b8f4a0e52942a90 David Mohr committed Apr 11, 2010
Showing with 72 additions and 28 deletions.
  1. +1 −0 .gitignore
  2. +0 −2 Makefile
  3. +0 −26 src/Makefile
  4. +23 −0 src/wscript_build
  5. BIN waf
  6. +48 −0 wscript
View
@@ -1 +1,2 @@
grub-choose-default.8
+_build_
View
@@ -1,2 +0,0 @@
-grub-choose-default.8: grub-choose-default.sgml
- docbook-to-man $< > $@
View
@@ -1,26 +0,0 @@
-CFLAGS=`pkg-config --cflags gtk+-2.0` -O0 -Wall -g
-LDFLAGS= `pkg-config --libs gtk+-2.0`
-
-all: gchd-test grub-choose-default
-
-grub-choose-default: grub-choose-default-main.o grub-choose-default-button-box.o grub-choose-default-window.o grub-choose-default-widget.o grub-choose-default-util.o gchd-error.o gchd-menu.o gchd.o gchd-unix.o
- $(CC) $(LDFLAGS) -o $@ $^
-
-gchd-test: gchd-test.o gchd-menu.o gchd-error.o gchd.o gchd-unix.o
- $(CC) $(LDFLAGS) -o $@ $^
-
-gchd.o: gchd.c gchd.h gchd-internal.h
-gchd-menu.o: gchd-menu.c gchd-menu.h gchd-error.h
-gchd-unix.o: gchd-unix.c gchd-unix.h gchd-internal.h
-gchd-error.o: gchd-error.c gchd-error.h
-
-gchd-test.o: gchd-test.c gchd.h
-
-grub-choose-default-button-box.o: grub-choose-default-button-box.c grub-choose-default-button-box.h
-grub-choose-default-main.o: grub-choose-default-main.c grub-choose-default-window.h
-grub-choose-default-window.o: grub-choose-default-window.c grub-choose-default-window.h
-grub-choose-default-widget.o: grub-choose-default-widget.c grub-choose-default-widget.h
-grub-choose-default-util.o: grub-choose-default-util.c grub-choose-default-util.h
-
-clean:
- rm *.o grub-choose-default gchd-test
View
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+
+COMMON = ('gchd-error.c', 'gchd-unix.c', 'gchd-menu.c', 'gchd.c')
+
+gchd = bld (features = 'cc cprogram',
+ includes = '# .',
+ uselib = 'GTK',
+ target = 'grub-choose-default')
+
+gchd.source = COMMON + ('grub-choose-default-button-box.c',
+ 'grub-choose-default-main.c',
+ 'grub-choose-default-util.c',
+ 'grub-choose-default-widget.c',
+ 'grub-choose-default-window.c',
+ )
+
+test = bld (features = 'cc cprogram',
+ includes = '# .',
+ uselib = 'GTK',
+ target = 'gchd-test')
+
+test.source = COMMON + ('gchd-test.c',
+ )
View
BIN waf
Binary file not shown.
View
48 wscript
@@ -0,0 +1,48 @@
+#!/usr/bin/env python
+
+#from __future__ import print_function
+
+top = '.'
+out = '_build_'
+
+APPNAME = 'grub-choose-default'
+VERSION = '0.7'
+
+def set_options (opt):
+ opt.add_option ('--debug', action='store_true', default=False, help='Enable debugging code', dest='debug')
+
+def configure (ctx):
+ print "Configuring", APPNAME
+
+ ctx.check_tool ('gcc')
+ ctx.check_cfg (package='gtk+-2.0', args='--cflags --libs', uselib_store='GTK', mandatory=True)
+
+ ctx.check (header_name='string.h', define_name='HAVE_STRING_H')
+ ctx.check (header_name='sys/stat.h', define_name='HAVE_SYS_STAT_H')
+ ctx.check (header_name='sys/types.h', define_name='HAVE_SYS_TYPES_H')
+ ctx.check (header_name='unistd.h', define_name='HAVE_UNISTD_H')
+
+ ctx.define ('VERSION', VERSION)
+ ctx.define ('PACKAGE', APPNAME)
+
+ ctx.env.append_value ('CCFLAGS', '-DHAVE_CONFIG_H')
+
+ ctx.write_config_header ('config.h')
+
+def build (ctx):
+ #ctx.recurse ('src')
+ ctx.add_subdirs ('src')
+
+# ctx.new_task_gen (
+# features = 'subst',
+# source = 'grub-choose-default.sgml',
+# target = 'grub-choose-default.8',
+# dict = { 'VERSION' : VERSION },
+# install_path = '${MANDIR}/man8'
+# )
+ ctx(
+ rule = 'docbook-to-man ${SRC} > ${TGT}',
+ source = 'grub-choose-default.sgml',
+ target = 'grub-choose-default.8',
+ install_path = '${MANDIR}/man8',
+ )

0 comments on commit 7bc8427

Please sign in to comment.