Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
create main makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
mintty committed Jun 16, 2015
1 parent 4765275 commit b1e1917
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 6 deletions.
73 changes: 73 additions & 0 deletions Makefile
@@ -0,0 +1,73 @@
# Interesting make targets:
# - exe: Just the executable. This is the default.
# - tar: Source tarball.
# - zip: Zip for standalone release.
# - pkg: Cygwin package.
# - pdf: PDF version of the manual page.
# - clean: Delete generated files.

# Variables intended for setting on the make command line.
# - RELEASE: release number for packaging
# - TARGET: target triple for cross compiling

exe:
cd src; $(MAKE) exe

zip:
cd src; $(MAKE) zip

pdf:
cd src; $(MAKE) pdf

clean:
cd src; $(MAKE) clean

NAME := mintty
version := \
$(shell echo $(shell echo VERSION | cpp -P $(CPPFLAGS) --include src/appinfo.h))
name_ver := $(NAME)-$(version)

DIST := release
TARUSER := --owner=root --group=root --owner=mintty --group=cygwin

src_files := Makefile COPYING LICENSE* INSTALL VERSION
src_files += src/Makefile src/*.c src/*.h src/*.rc src/*.mft
src_files += cygwin/*.cygport cygwin/README* cygwin/setup.hint
src_files += docs/*.1 docs/*.html icon/* scripts/*

generated := docs/$(NAME).1.html

docs/$(NAME).1.html: docs/$(NAME).1
cd src; $(MAKE) html
cp docs/$(NAME).1.html mintty.github.io/

src := $(DIST)/$(name_ver)-src.tar.bz2
tar: $(generated) $(src)
$(src): $(src_files)
mkdir -p $(DIST)
rm -rf $(name_ver)
mkdir $(name_ver)
#cp -ax --parents $^ $(name_ver)
cp -dl --parents $^ $(name_ver)
rm -f $@
tar cjf $@ --exclude="*~" $(TARUSER) $(name_ver)
rm -rf $(name_ver)

REL := 0
arch := $(shell uname -m)

cygport := $(name_ver)-$(REL).cygport
pkg: binpkg srcpkg

binpkg:
cp cygwin/mintty.cygport $(DIST)/$(cygport)
cd $(DIST); cygport $(cygport) prep
cd $(DIST); cygport $(cygport) compile install
#cd $(DIST); cygport $(cygport) package
cd $(DIST)/$(name_ver)-$(REL).$(arch)/inst; tar cJf ../$(name_ver)-$(REL).tar.xz $(TARUSER) *

srcpkg: $(DIST)/$(name_ver)-$(REL)-src.tar.xz

$(DIST)/$(name_ver)-$(REL)-src.tar.xz: $(DIST)/$(name_ver)-src.tar.bz2
cd $(DIST); tar cJf $(name_ver)-$(REL)-src.tar.xz $(name_ver)-src.tar.bz2 $(name_ver)-$(REL).cygport

1 change: 1 addition & 0 deletions VERSION
@@ -0,0 +1 @@
The version number is configured in src/appinfo.h
12 changes: 6 additions & 6 deletions src/Makefile
Expand Up @@ -90,8 +90,8 @@ endif
#############################################################################
# build

#DEPOPT=-MMD -MP
DEPOPT=
DEPOPT=-MMD -MP
#DEPOPT=

%.o: %.c
$(CC) -c $(DEPOPT) $(CPPFLAGS) $(CFLAGS) $<
Expand All @@ -110,7 +110,7 @@ $(exe): $(objs)
#############################################################################
# release targets

REL := ../release
DIST := ../release

ifndef RELEASE
RELEASE=0
Expand All @@ -125,14 +125,14 @@ $(pkg): $(cygport) $(src)
cygport $(cygport_opts) $(pkg).cygport almostall
endif

zip := $(REL)/$(name_ver)-$(platform).zip
zip := $(DIST)/$(name_ver)-$(platform).zip
zip: $(zip)
$(zip): $(exe) $(zip_files)
mkdir -p $(REL)
mkdir -p $(DIST)
zip -9 -j $@ $^
-du -b $@

pdf := $(REL)/$(name_ver).pdf
pdf := $(DIST)/$(name_ver).pdf
pdf: $(pdf)
$(pdf): ../docs/$(NAME).1
groff -t -man -Tps $< | ps2pdf - $@
Expand Down

0 comments on commit b1e1917

Please sign in to comment.