source: GNUmakefile @ da65757

Revision da65757, 4.2 KB checked in by Hal Finkel <hfinkel@…>, 9 years ago (diff)

add license to all files

  • Property mode set to 100644
Line 
1#                    Copyright (C) 2015, UChicago Argonne, LLC
2#                               All Rights Reserved
3#
4#                               Generic IO (ANL-15-066)
5#                     Hal Finkel, Argonne National Laboratory
6#
7#                              OPEN SOURCE LICENSE
8#
9# Under the terms of Contract No. DE-AC02-06CH11357 with UChicago Argonne,
10# LLC, the U.S. Government retains certain rights in this software.
11#
12# Redistribution and use in source and binary forms, with or without
13# modification, are permitted provided that the following conditions are met:
14#
15#   1. Redistributions of source code must retain the above copyright notice,
16#      this list of conditions and the following disclaimer.
17#
18#   2. Redistributions in binary form must reproduce the above copyright
19#      notice, this list of conditions and the following disclaimer in the
20#      documentation and/or other materials provided with the distribution.
21#
22#   3. Neither the names of UChicago Argonne, LLC or the Department of Energy
23#      nor the names of its contributors may be used to endorse or promote
24#      products derived from this software without specific prior written
25#      permission.
26#
27# *****************************************************************************
28#
29#                                  DISCLAIMER
30# THE SOFTWARE IS SUPPLIED “AS IS” WITHOUT WARRANTY OF ANY KIND.  NEITHER THE
31# UNTED STATES GOVERNMENT, NOR THE UNITED STATES DEPARTMENT OF ENERGY, NOR
32# UCHICAGO ARGONNE, LLC, NOR ANY OF THEIR EMPLOYEES, MAKES ANY WARRANTY,
33# EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE
34# ACCURACY, COMPLETENESS, OR USEFULNESS OF ANY INFORMATION, DATA, APPARATUS,
35# PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS THAT ITS USE WOULD NOT INFRINGE
36# PRIVATELY OWNED RIGHTS.
37#
38# *****************************************************************************
39
40CC = gcc
41CXX = g++
42
43MPICC = mpicc
44MPICXX = mpicxx
45
46all: fe-progs mpi-progs
47sql: fe-sqlite
48
49FEDIR = frontend
50FE_CFLAGS := -g -fPIC -O3 -fopenmp
51FE_CPPFLAGS := -Ithirdparty/blosc -Ithirdparty/sqlite -DGENERICIO_NO_MPI
52
53MPIDIR = mpi
54MPI_CFLAGS := -g -O3
55MPI_CPPFLAGS := -Ithirdparty/blosc
56
57$(FEDIR):
58        mkdir -p $(FEDIR)
59
60$(FEDIR)/%.o: thirdparty/blosc/%.c | $(FEDIR)
61        $(CC) $(FE_CFLAGS) $(FE_CPPFLAGS) -c -o $@ $<
62
63$(FEDIR)/%.o: %.cxx | $(FEDIR)
64        $(CXX) $(FE_CFLAGS) $(FE_CPPFLAGS) -c -o $@ $<
65
66$(FEDIR)/GenericIOPrint: $(FEDIR)/GenericIOPrint.o $(FEDIR)/GenericIO.o  $(FEDIR)/blosc.o $(FEDIR)/blosclz.o $(FEDIR)/shuffle.o
67        $(CXX) $(FE_CFLAGS) -o $@ $^
68
69$(FEDIR)/GenericIOVerify: $(FEDIR)/GenericIOVerify.o $(FEDIR)/GenericIO.o $(FEDIR)/blosc.o $(FEDIR)/blosclz.o $(FEDIR)/shuffle.o
70        $(CXX) $(FE_CFLAGS) -o $@ $^
71
72FE_UNAME := $(shell uname -s)
73ifeq ($(FE_UNAME),Darwin)
74FE_SHARED := -bundle
75else
76FE_SHARED := -shared
77endif
78$(FEDIR)/GenericIOSQLite.so: $(FEDIR)/GenericIOSQLite.o $(FEDIR)/GenericIO.o
79        $(CXX) $(FE_CFLAGS) $(FE_SHARED) -o $@ $^
80
81SQLITE_CPPFLAGS := -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_ENABLE_FTS3=3 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -DSQLITE_ENABLE_LOAD_EXTENSION=1 -DHAVE_READLINE=1
82
83$(FEDIR)/sqbuild:
84        mkdir -p $(FEDIR)/sqbuild
85
86$(FEDIR)/sqbuild/%.o: thirdparty/sqlite/%.c | $(FEDIR)/sqbuild
87        $(CC) $(FE_CFLAGS) $(FE_CPPFLAGS) $(SQLITE_CPPFLAGS) -c -o $@ $<
88
89$(FEDIR)/sqlite3: $(FEDIR)/sqbuild/sqlite3.o $(FEDIR)/sqbuild/shell.o
90        $(CC) $(FE_CFLAGS) -o $@ $^ -pthread -lreadline -lrt -ldl
91
92$(MPIDIR):
93        mkdir -p $(MPIDIR)
94
95$(MPIDIR)/%.o: thirdparty/blosc/%.c | $(MPIDIR)
96        $(MPICC) $(MPI_CFLAGS) $(MPI_CPPFLAGS) -c -o $@ $<
97
98$(MPIDIR)/%.o: %.cxx | $(MPIDIR)
99        $(MPICXX) $(MPI_CFLAGS) $(MPI_CPPFLAGS) -c -o $@ $<
100
101$(MPIDIR)/GenericIOPrint: $(MPIDIR)/GenericIOPrint.o $(MPIDIR)/GenericIO.o $(MPIDIR)/blosc.o $(MPIDIR)/blosclz.o $(MPIDIR)/shuffle.o
102        $(MPICXX) $(MPI_CFLAGS) -o $@ $^
103
104$(MPIDIR)/GenericIOVerify: $(MPIDIR)/GenericIOVerify.o $(MPIDIR)/GenericIO.o $(MPIDIR)/blosc.o $(MPIDIR)/blosclz.o $(MPIDIR)/shuffle.o
105        $(MPICXX) $(MPI_CFLAGS) -o $@ $^
106
107frontend-progs: $(FEDIR)/GenericIOPrint $(FEDIR)/GenericIOVerify
108fe-progs: frontend-progs
109
110mpi-progs: $(MPIDIR)/GenericIOPrint $(MPIDIR)/GenericIOVerify
111
112frontend-sqlite: $(FEDIR)/GenericIOSQLite.so $(FEDIR)/sqlite3
113fe-sqlite: frontend-sqlite
114
115clean:
116        rm -rf frontend mpi
117
Note: See TracBrowser for help on using the repository browser.