modified how dist is build; changed .gitignore hierarchy

there is now a toplevel makefile for making dist, so that we can keep
the project build systems separate (in src and contrib/UI*), and then
build dist from the root dir
partial-rewrite
Ben Blazak 2012-06-12 14:12:50 -07:00
parent e37ff92137
commit 5260e7104d
4 changed files with 63 additions and 21 deletions

10
.gitignore vendored
View File

@ -1,10 +1,2 @@
*~
*.swp
*.eep
*.elf
*.hex
*.map
*.o
*.o.dep
*.zip

53
makefile Normal file
View File

@ -0,0 +1,53 @@
# -----------------------------------------------------------------------------
# makefile for the ergoDOX project
#
# This should produce a single file (probably in an archive format) for
# distribution, containing everything people will need to use the software.
#
# AVAILABILITY: This is unabashedly dependant on various Unix commands, and
# therefore probably won't work in a Windows environment. I'm sorry. I don't
# know a good portable way to write it.
#
# TODO:
# - include doc files (and maybe render them in html)
# - include the UI stuff (once it's done)
# -----------------------------------------------------------------------------
# Copyright (c) 2012 Ben Blazak <benblazak.dev@gmail.com>
# Released under The MIT License (MIT) (see "license.md")
# Project located at <https://github.com/benblazak/ergodox-firmware>
# -----------------------------------------------------------------------------
# the base name of the file or package to distribute
NAME := ergodox-firmware
# the branch of the git repo we're currently on
BRANCH := $(shell git branch -l | grep '*' | cut -c 3-)
# a version identifier
VERSION := $(shell date +'%Y%m%d_%H%M%S')
# name to use for the final distribution file or package
TARGET = $(NAME)--$(BRANCH)--$(VERSION)
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
.PHONY: all clean dist
all: dist
clean:
git clean -dX # remove ignored files and directories
dist: src contrib/UI
# -----------------------------------------------------------------------------
.PHONY: src contrib/UI
src:
cd src; $(MAKE) all
zip '$(TARGET)' src/*.hex src/*.elf src/*.map
contrib/UI:
# nothing yet

7
src/.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
*.eep
*.elf
*.hex
*.map
*.o
*.o.dep

View File

@ -1,5 +1,5 @@
# -----------------------------------------------------------------------------
# makefile for the ergoDOX project
# makefile for the ergoDOX firmware
#
# - .h file dependencies are automatically generated
#
@ -122,17 +122,7 @@ all: $(TARGET).hex $(TARGET).eep
clean:
@echo
@echo --- cleaning ---
cd .. ; git clean -dX # remove ignored files and directories
# availability: linux
dist: clean all
name='ergodox-firmware'; \
branch='$(shell git branch -l | grep '*' | cut -c 3-)'; \
date='$(shell date +'%Y%m%d_%H%M%S')'; \
\
zip "$$name--$$branch--$$date.zip" "$(TARGET).hex" "$(TARGET).map"; \
\
make clean
git clean -dX # remove ignored files and directories
# -----------------------------------------------------------------------------