diff --git a/apps/hello1/Makefile b/apps/hello1/Makefile index 1f473b6..942ef33 100644 --- a/apps/hello1/Makefile +++ b/apps/hello1/Makefile @@ -5,7 +5,7 @@ # Definitions. CC = avr-gcc -CFLAGS = -mmcu=atmega32u2 -Os -Wall -Wstrict-prototypes -Wextra -g -I -I../../drivers -I../../drivers/avr -I../../utils +CFLAGS = -mmcu=atmega32u2 -Os -Wall -Wstrict-prototypes -Wextra -g -I. -I../../drivers -I../../drivers/avr -I../../utils OBJCOPY = avr-objcopy SIZE = avr-size DEL = rm diff --git a/apps/space10/Makefile b/apps/space10/Makefile index 9419fd5..98aa773 100644 --- a/apps/space10/Makefile +++ b/apps/space10/Makefile @@ -5,7 +5,7 @@ # Definitions. CC = avr-gcc -CFLAGS = -mmcu=atmega32u2 -Os -Wall -Wstrict-prototypes -Wextra -g -I -I../../drivers -I../../fonts -I../../drivers/avr -I../../utils +CFLAGS = -mmcu=atmega32u2 -Os -Wall -Wstrict-prototypes -Wextra -g -I. -I../../drivers -I../../fonts -I../../drivers/avr -I../../utils OBJCOPY = avr-objcopy SIZE = avr-size DEL = rm diff --git a/apps/space11/Makefile b/apps/space11/Makefile index 053a38a..c45e7a9 100644 --- a/apps/space11/Makefile +++ b/apps/space11/Makefile @@ -5,7 +5,7 @@ # Definitions. CC = avr-gcc -CFLAGS = -mmcu=atmega32u2 -Os -Wall -Wstrict-prototypes -Wextra -g -I -I../../drivers -I../../fonts -I../../drivers/avr -I../../utils +CFLAGS = -mmcu=atmega32u2 -Os -Wall -Wstrict-prototypes -Wextra -g -I. -I../../drivers -I../../fonts -I../../drivers/avr -I../../utils OBJCOPY = avr-objcopy SIZE = avr-size DEL = rm diff --git a/apps/space9/Makefile b/apps/space9/Makefile index 09d6272..84b55e9 100644 --- a/apps/space9/Makefile +++ b/apps/space9/Makefile @@ -5,7 +5,7 @@ # Definitions. CC = avr-gcc -CFLAGS = -mmcu=atmega32u2 -Os -Wall -Wstrict-prototypes -Wextra -g -I -I../../drivers -I../../fonts -I../../drivers/avr -I../../utils +CFLAGS = -mmcu=atmega32u2 -Os -Wall -Wstrict-prototypes -Wextra -g -I. -I../../drivers -I../../fonts -I../../drivers/avr -I../../utils OBJCOPY = avr-objcopy SIZE = avr-size DEL = rm diff --git a/etc/makemake.py b/etc/makemake.py index 60e361a..fbcb567 100755 --- a/etc/makemake.py +++ b/etc/makemake.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -"""makemake V0.09 +"""makemake V0.10 Copyright (c) 2010 Michael P. Hayes, UC ECE, NZ This program tries to make a Makefile from a template. Given a C file @@ -122,6 +122,19 @@ def hfiles_get_all (filedeps): return files_get_all (filedeps, '.h') +def paths_prune (filelist): + + relpaths = unique ([os.path.dirname (os.path.relpath (path)) for path in filelist]) + + relpaths = unique (relpaths) + + if '' in relpaths: + relpaths.remove ('') + relpaths.insert (0, '.') + + return relpaths + + def file_parse (pathname, indent, debug): if debug: @@ -162,13 +175,8 @@ def makefile_print (options, template, maincfilename, filedeps, hfilelist = hfiles_get_all (filedeps) - includedirs = unique ([os.path.dirname (os.path.relpath (path)) for path in hfilelist]) - - moduledirs = unique ([os.path.dirname (os.path.relpath (path)) for path in cfilelist]) - if options.debug: - print >> sys.stderr, includedirs - print >> sys.stderr, moduledirs - + includedirs = paths_prune (hfilelist) + moduledirs = paths_prune (cfilelist) vpath = ' '.join (moduledirs) includes = '-I' + ' -I'.join (includedirs)