mirror of
				https://github.com/flynx/photobook.git
				synced 2025-10-29 02:10:08 +00:00 
			
		
		
		
	still can't decide how to install by default -> added modes (strip/link/copy) to experiment...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									cfac97cff9
								
							
						
					
					
						commit
						10308860a8
					
				
							
								
								
									
										41
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										41
									
								
								Makefile
									
									
									
									
									
								
							| @ -17,31 +17,46 @@ | |||||||
| # 	clean			- cleanup repo
 | # 	clean			- cleanup repo
 | ||||||
| #
 | #
 | ||||||
| # Variables:
 | # Variables:
 | ||||||
| # 	STRIP_CODE		- if "yes" strip docs from installed code
 | # 	CODE_INSTALL	- set how we handle the installing code/source.
 | ||||||
| # 						(only for install and install-local targets)
 | # 						this can be:
 | ||||||
|  | # 							strip		- strip the docs from code
 | ||||||
|  | # 							copy		- copy the code/doc file
 | ||||||
|  | # 							link		- link the code/doc files
 | ||||||
| # 	INSTALL_PATH	- install path
 | # 	INSTALL_PATH	- install path
 | ||||||
| # 						(only for install target)
 | # 						(only for install target)
 | ||||||
| #
 | #
 | ||||||
| #
 | #
 | ||||||
| # Examples:
 | # Examples:
 | ||||||
| #
 | #
 | ||||||
| # 	$ INSTALL_PATH=./test STRIP_CODE=no make install
 | # 	$ INSTALL_PATH=./test CODE_INSTALL=link make install
 | ||||||
| # 		install to "./test" and do not strip docs.
 | # 		install to "./test" and do not strip docs.
 | ||||||
| #
 | #
 | ||||||
| #
 | #
 | ||||||
| #----------------------------------------------------------------------
 | #----------------------------------------------------------------------
 | ||||||
| # Config...
 | # Config...
 | ||||||
| 
 | 
 | ||||||
|  | .EXPORT_ALL_VARIABLES: | ||||||
|  | 
 | ||||||
| # NOTE: this makes things run consistently on different systems including 
 | # NOTE: this makes things run consistently on different systems including 
 | ||||||
| # 		things like Android...
 | # 		things like Android...
 | ||||||
| SHELL := bash | SHELL := bash | ||||||
| 
 | 
 | ||||||
| MODULE := photobook | MODULE := photobook | ||||||
| 
 | 
 | ||||||
| #STRIP_CODE ?= no
 |  | ||||||
| STRIP_CODE ?= yes |  | ||||||
| 
 | 
 | ||||||
| ifeq ($(STRIP_CODE),yes) | # this can be:
 | ||||||
|  | # 	- strip
 | ||||||
|  | # 	- copy
 | ||||||
|  | # 	- link
 | ||||||
|  | #
 | ||||||
|  | # NOTE: we are doing things in different ways for different modes:
 | ||||||
|  | # 		copy vs. strip
 | ||||||
|  | # 			- simply change the target name and let make figure it out...
 | ||||||
|  | # 		link vs. copy/strip
 | ||||||
|  | # 			- either do $(LN) or $(CP) in the install target...
 | ||||||
|  | CODE_INSTALL ?= strip | ||||||
|  | 
 | ||||||
|  | ifeq ($(CODE_INSTALL),strip) | ||||||
| 	MODULE_CODE := $(MODULE)-stripped | 	MODULE_CODE := $(MODULE)-stripped | ||||||
| else | else | ||||||
| 	MODULE_CODE := $(MODULE) | 	MODULE_CODE := $(MODULE) | ||||||
| @ -86,8 +101,9 @@ TEX := latexmk -lualatex | |||||||
| # Doc generator...
 | # Doc generator...
 | ||||||
| DOC := ./scripts/cls2tex.sh | DOC := ./scripts/cls2tex.sh | ||||||
| 
 | 
 | ||||||
| CP := cp |  | ||||||
| MD := mkdir -p | MD := mkdir -p | ||||||
|  | CP := cp | ||||||
|  | LN := cp -l | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -175,13 +191,22 @@ all: doc | |||||||
| 		$(MODULE)-stripped.sty \
 | 		$(MODULE)-stripped.sty \
 | ||||||
| 		$(MODULE)-stripped.tex | 		$(MODULE)-stripped.tex | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| # user install...
 | # user install...
 | ||||||
| .PHONY: install | .PHONY: install | ||||||
| install: doc $(MODULE_CODE).cls | install: doc $(MODULE_CODE).cls | ||||||
| 	$(MD) $(INSTALL_PATH)/{tex,source,doc}/latex/$(MODULE) | 	$(MD) $(INSTALL_PATH)/{tex,source,doc}/latex/$(MODULE) | ||||||
| 	$(CP) $(MODULE).cls $(INSTALL_PATH)/source/latex/$(MODULE) |  | ||||||
| 	$(CP) $(MODULE).pdf $(INSTALL_PATH)/doc/latex/$(MODULE) | 	$(CP) $(MODULE).pdf $(INSTALL_PATH)/doc/latex/$(MODULE) | ||||||
| 	$(CP) $(MODULE_CODE).cls $(INSTALL_PATH)/tex/latex/$(MODULE)/$(MODULE).cls | 	$(CP) $(MODULE_CODE).cls $(INSTALL_PATH)/tex/latex/$(MODULE)/$(MODULE).cls | ||||||
|  | #	# NOTE: we are printing only the stuff we are doing...
 | ||||||
|  | 	@run(){ echo "$$@" ;  "$$@" ; } ;\
 | ||||||
|  | 	if [[ $${CODE_INSTALL} == "link" ]] ; then \
 | ||||||
|  | 		run $(LN) \
 | ||||||
|  | 			"$(INSTALL_PATH)/tex/latex/$(MODULE)/$(MODULE).cls" \
 | ||||||
|  | 			"$(INSTALL_PATH)/source/latex/$(MODULE)/" ;\
 | ||||||
|  | 	else \
 | ||||||
|  | 		run $(CP) "$(MODULE).cls" "$(INSTALL_PATH)/source/latex/$(MODULE)" ;\
 | ||||||
|  | 	fi | ||||||
| 
 | 
 | ||||||
| .PHONY: uninstall | .PHONY: uninstall | ||||||
| uninstall: | uninstall: | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user