25
25
# #########################################################################
26
26
27
27
# Installation directory
28
- BINDIR =/usr/local/bin
28
+ INSTALLDIR =/usr/local/bin
29
29
30
30
# Libraries
31
31
GDAL_INCLUDES = -I/usr/include/gdal
@@ -69,11 +69,16 @@ CFLAGS=-O3 -Wall -fopenmp
69
69
70
70
# #########################################################################
71
71
72
- # Directories
72
+ # Compile directories
73
73
SRCDIR = src
74
74
OBJDIR = obj
75
75
BINDIR = bin
76
76
77
+ # Script directories
78
+ BASHDIR = bash
79
+ RSTATSDIR = rstats
80
+ PYTHONDIR = python
81
+
77
82
# Create necessary directories
78
83
$(shell mkdir -p $(OBJDIR) $(BINDIR) $(BINDIR)/force-test $(BINDIR)/force-misc)
79
84
@@ -109,16 +114,15 @@ TEST_EXE = $(patsubst $(SRCDIR)/tests/%.c, $(BINDIR)/force-test/%, $(TEST_SRC))
109
114
DEPENDENCIES = $(CROSS_OBJ:.o=.d ) $(LOWER_OBJ:.o=.d ) $(HIGHER_OBJ:.o=.d ) $(AUX_OBJ:.o=.d )
110
115
111
116
# Targets
112
- all : exe tests
113
- exe : aux_exe higher_exe lower_exe
114
- aux_exe : $(MAIN_AUX_EXE )
115
- higher_exe : $(MAIN_HIGHER_EXE )
116
- lower_exe : $(MAIN_LOWER_EXE )
117
+ all : exe tests scripts
118
+ exe : aux higher lower
119
+ aux : $(MAIN_AUX_EXE )
120
+ higher : $(MAIN_HIGHER_EXE )
121
+ lower : $(MAIN_LOWER_EXE )
117
122
tests : $(TEST_EXE )
123
+ scripts : bash rstats python external
118
124
dev : $(BINDIR ) /force-stratified-sample # specific target for development
119
- # tests: test_utils-cl test_alloc-cl
120
- # exe: force-parameter force-qai-inflate force-tile-finder force-tabulate-grid force-l2ps force-higher-level force-train force-lut-modis force-mdcp force-stack force-import-modis force-cube-init force-hist force-stratified-sample
121
- # all: temp cross lower higher aux exe unit-tests
125
+ .PHONY : bash rstats python external scripts install
122
126
# .PHONY: temp all install install_ bash python rstats misc external clean build check
123
127
124
128
# Include dependencies
@@ -231,25 +235,59 @@ $(BINDIR)/%: $(SRCDIR)/main/higher-level/%.c $(CROSS_OBJ) $(HIGHER_OBJ)
231
235
@echo " Compiling $<..."
232
236
$(CXX ) $(CFLAGS ) $(INCLUDES ) $(FLAGS ) -o $@ $^ $(LIBS )
233
237
238
+
234
239
# Test executables
235
240
236
241
$(BINDIR ) /force-test/% : $(SRCDIR ) /tests/% .c $(SRCDIR ) /tests/unity/unity.c $(CROSS_OBJ )
237
242
@echo " Compiling $<..."
238
243
$(CXX ) $(CFLAGS ) $(INCLUDES ) $(FLAGS ) -o $@ $^ $(LIBS )
239
244
240
245
246
+ # Bash scripts
247
+
248
+ bash :
249
+ @for file in $(BASHDIR ) /* .sh; do \
250
+ cp $$ file $(BINDIR ) /$$(basename $$file .sh) ; \
251
+ done
252
+
253
+
254
+ # R scripts
255
+
256
+ rstats :
257
+ @for file in $(RSTATSDIR ) /* .r; do \
258
+ cp $$ file $(BINDIR ) /$$(basename $$file .r) ; \
259
+ done
260
+
261
+
262
+ # Python scripts
263
+
264
+ python :
265
+ @for file in $(PYTHONDIR ) /* .py; do \
266
+ cp $$ file $(BINDIR ) /$$(basename $$file .py) ; \
267
+ done
268
+
269
+
270
+ # re-branded tools [with permission]
271
+
272
+ external :
273
+ cp $(shell which landsatlinks) $(BINDIR ) /force-level1-landsat
274
+
275
+
241
276
# ## dummy code for testing stuff
242
277
243
278
# dummy: temp cross aux higher src/dummy.c
244
279
# $(G11) $(CFLAGS) $(GDAL) $(GSL) $(CURL) $(SPLITS) $(OPENCV) $(PYTHON) $(PYTHON2) $(RSTATS) -o $(TB)/dummy src/dummy.c $(TC)/*.o $(TA)/*.o $(TH)/*.o $(LDGDAL) $(LDGSL) $(LDCURL) $(LDSPLITS) $(LDOPENCV) $(LDPYTHON) $(LDRSTATS)
245
280
246
281
247
- # ## MISC
282
+ # install the software
283
+
284
+ install : all
285
+ find $(BINDIR ) -type f -exec chmod 0755 {} +
286
+ find $(BINDIR ) -type d -exec chmod 0755 {} +
287
+ cp -a $(BINDIR ) /. $(INSTALLDIR )
248
288
249
- # install_:
250
- # chmod 0755 $(TB)/*
251
- # chmod 0755 $(TU)/*
252
- # cp -a $(TB)/. $(BINDIR)
289
+
290
+ # clean up
253
291
254
292
clean :
255
293
rm -rf $(OBJDIR ) $(BINDIR )
@@ -267,35 +305,3 @@ clean:
267
305
# misc: temp
268
306
# $(foreach miscfiles,$(FORCE_MISC),\
269
307
# $(shell cp $(DD)/$(miscfiles) -t $(TM)))
270
-
271
- # bash: temp
272
- # cp $(DB)/force-info.sh $(TB)/force-info
273
- # cp $(DB)/force-cube.sh $(TB)/force-cube
274
- # cp $(DB)/force-level1-csd.sh $(TB)/force-level1-csd
275
- # cp $(DB)/force-level2.sh $(TB)/force-level2
276
- # cp $(DB)/force-mosaic.sh $(TB)/force-mosaic
277
- # cp $(DB)/force-pyramid.sh $(TB)/force-pyramid
278
- # cp $(DB)/force-procmask.sh $(TB)/force-procmask
279
- # cp $(DB)/force-tile-extent.sh $(TB)/force-tile-extent
280
- # cp $(DB)/force-magic-parameters.sh $(TB)/force-magic-parameters
281
- # cp $(DB)/force-level2-report.sh $(TB)/force-level2-report
282
- # cp $(DB)/force-init.sh $(TB)/force-init
283
- # cp $(DB)/force-datacube-size.sh $(TB)/force-datacube-size
284
- # cp $(DB)/force-unit-testing.sh $(TB)/force-unit-testing
285
-
286
- # external: temp
287
- # cp $(shell which landsatlinks) $(TB)/force-level1-landsat
288
-
289
- # python: temp
290
- # cp $(DP)/force-synthmix.py $(TB)/force-synthmix
291
-
292
- # rstats: temp
293
- # cp $(DR)/force-sample-size.r $(TB)/force-sample-size
294
- # cp $(DR)/force-map-accuracy.r $(TB)/force-map-accuracy
295
-
296
- # install: bash python rstats misc external install_ clean check
297
-
298
- # build:
299
- # $(eval V := $(shell grep '#define _VERSION_' src/cross-level/const-cl.h | cut -d '"' -f 2 | sed 's/ /_/g'))
300
- # $(eval T :=$(shell date +"%Y%m%d%H%M%S"))
301
- # tar -czf force_v$(V)_$(T).tar.gz src bash python rstats misc external images docs Makefile LICENSE README.md
0 commit comments