source: app/Makefile @ 20b4e44

help
Last change on this file since 20b4e44 was 20b4e44, checked in by pawelk <pawelk@…>, 17 years ago

Wersja niestabilna, zawiera wstepne poprawki.

git-svn-id: svn://atos.wmid.amu.edu.pl/utt@13 e293616e-ec6a-49c2-aa92-f4a8b91c5d16

  • Property mode set to 100644
File size: 4.1 KB
RevLine 
[25ae32e]1# main makefile
2
[8d3e6ab]3# ******************************
4# * Local variables
5# ******************************
6CUR_DIR=$(shell pwd)
7SRC_DIR=$(CUR_DIR)/src
8OUTPUT_DIR=$(CUR_DIR)/output
[25ae32e]9
[8d3e6ab]10# ******************************
11# * Global for make globals
12# ******************************
[25ae32e]13
[8d3e6ab]14export UTT_DIR=${OUTPUT_DIR}
[25ae32e]15
[b2647de]16# executables
17export UTT_BIN_DIR=${UTT_DIR}/bin
18# configuration files
19export UTT_CONF_DIR=${UTT_DIR}/etc/utt
20# language/encoding specific stuff
21export UTT_LANG_DIR=${UTT_DIR}/share/utt
22# some files like ser.l.template, terms.m4
23export UTT_LIB_DIR=${UTT_DIR}/lib/utt
24# stuff like documantation (man, info), docs: FAQ, COPYRIGHT, NEWS, README
25export UTT_SHARE_DIR=${UTT_DIR}/share
[25ae32e]26
[8d3e6ab]27##############################
[25ae32e]28
29# list of components to be included in the distribution
[8d3e6ab]30COMPONENTS = compiledic cor fla gph grp kon kot lem mar rm12 rs12 sen-l sen-nl ser tags tok.l unfla
31# gue nie dziala!
[25ae32e]32
33##############################
34
[8d3e6ab]35# ------------------------------------------------------------------
36# sekcja kompilacji (kompiluje i wgrywa do OUTPUT_DIR)
37# ------------------------------------------------------------------
38.PHONY: compile
39compile: dirs components
40        @echo "Make compiled successfully!"
[25ae32e]41
42.PHONY: dirs
43dirs:
44        if [ -d ${UTT_DIR} ]; then rm -r ${UTT_DIR}; fi
45        mkdir -p ${UTT_DIR}
46        mkdir -p ${UTT_BIN_DIR}
47        mkdir -p ${UTT_CONF_DIR}
48        mkdir -p ${UTT_LANG_DIR}
[8d3e6ab]49        mkdir -p ${UTT_LIB_DIR}
[b2647de]50        mkdir -p ${UTT_SHARE_DIR}/utt
51        mkdir -p ${UTT_SHARE_DIR}/doc/utt
52        mkdir -p ${UTT_SHARE_DIR}/info
53        mkdir -p ${UTT_SHARE_DIR}/man/man3
[25ae32e]54
55.PHONY: components
56components:
[20b4e44]57        cd $(SRC_DIR)/lib && make; cd $(CUR_DIR)
58       
[25ae32e]59        @for cmp in $(COMPONENTS); do\
[8d3e6ab]60                cd $(SRC_DIR)/$$cmp && make && make copy; cd $(CUR_DIR); \
[25ae32e]61        done
62
63
[8d3e6ab]64# ------------------------------------------------------------------
65# sekcja sprzatania (kasuje binaria z katalogow SRC/COMPONENTS)
66# ------------------------------------------------------------------
67.PHONY: clean
[25ae32e]68clean: clean_components clean_doc clean_dist
69        @echo "All files cleaned successfully!"
70
[8d3e6ab]71.PHONY: clean_components
[25ae32e]72clean_components:
73        @for cmp in $(COMPONENTS); do \
[8d3e6ab]74                cd $(SRC_DIR)/$$cmp && make clean ; cd $(CUR_DIR); \
[25ae32e]75        done
[8d3e6ab]76        cd $(SRC_DIR)/lib && make clean; cd $(CUR_DIR);
[25ae32e]77
[8d3e6ab]78.PHONY: clean_doc
[25ae32e]79clean_doc:
[b2647de]80        cd $(CUR_DIR)/doc && make clean; cd $(CUR_DIR)
[8d3e6ab]81
82.PHONY: clean_dist
83clean_dist:
[25ae32e]84
85
[8d3e6ab]86# ------------------------------------------------------------------
87# sekcja przygotowania paczki (programow wraz z dodatkowymi plikami)
88# ------------------------------------------------------------------
89.PHONY: build
[b2647de]90build: compile build_conf build_lib build_doc
[8d3e6ab]91        @echo "All files builded successfully!"
[25ae32e]92
[8d3e6ab]93.PHONY: build_conf
94build_conf:
[b2647de]95        cp $(CUR_DIR)/conf/*.conf $(UTT_CONF_DIR)/
[25ae32e]96
[8d3e6ab]97.PHONY: build_lib
98build_lib:
99        cp $(CUR_DIR)/lib/* $(UTT_LIB_DIR)/
[25ae32e]100
[b2647de]101.PHONY: build_doc
102build_doc:
103        cd $(CUR_DIR)/doc && make && make copy; cd $(CUR_DIR)
[25ae32e]104
105
106
[8d3e6ab]107# ------------------------------------------------------------------
108# sekcja tworzenia dystrybucji (tarballa, rpm, deb)
109# ------------------------------------------------------------------
110.PHONY: distribute
[b2647de]111distribute: build dist_tarball dist_rpm
112        @echo "All distributions created successfully!"
[25ae32e]113
[b2647de]114.PHONY: dist_tarball
115dist_tarball: build
116        cd $(CUR_DIR)/dist && make tarball; cd $(CUR_DIR)
117
118.PHONY: dist_rpm
119dist_rpm: build
120        cd $(CUR_DIR)/dist && make rpm; cd $(CUR_DIR)
121
122.PHONY: dist_deb
123dist_deb: build
124        cd $(CUR_DIR)/dist && make deb; cd $(CUR_DIR)
[25ae32e]125
126
[8d3e6ab]127# ------------------------------------------------------------------
128# sekcja testowania (kasuje tarballa z TARBALL_TEST_DIR,
129# kompiluje, robi paczke,
130# tworzy tarballa i wgrywa go do TARBALL_TEST_DIR)
131# ------------------------------------------------------------------
132#install: all
133#       cd ${UTT_DIR} && make install; cd ${CUR_DIR}
[25ae32e]134
[8d3e6ab]135#uninstall:
136#       cd ${UTT_DIR} && make uninstall; cd ${DIR}
[25ae32e]137
[8d3e6ab]138#reinstall:
139#       cd ${UTT_DIR} && make reinstall; cd ${DIR}
[25ae32e]140
[8d3e6ab]141#dist: all
142#       tar -czvf $(UTT_DIST_NAME).tgz $(UTT_DIR)
[25ae32e]143
144
[8d3e6ab]145#clean_dist:
146#       if [ -d $(UTT_DIST_DIR) ]; then rm -r $(UTT_DIST_DIR); else true; fi
147#       if [ -f $(UTT_DIST_FILE).tar.bz2 ]; then rm $(UTT_DIST_FILE).tar.bz2; else true; fi
148#       if [ -f $(UTT_DIST_PMDB_FILE).tar.bz2 ]; then rm $(UTT_DIST_PMDB_FILE).tar.bz2; else true; fi
Note: See TracBrowser for help on using the repository browser.