-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Makefile
124 lines (93 loc) · 3.78 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#
# $Id$
# Copyright (C) 2003 Pascal Brisset, Antoine Drouin
#
# This file is part of paparazzi.
#
# paparazzi is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# paparazzi is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with paparazzi; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
# Quiet compilation
Q=@
LBITS := $(shell getconf LONG_BIT)
ifeq ($(LBITS),64)
FPIC=-fPIC
OCAMLCFLAGS=-thread -ccopt -fPIC
else
FPIC=
OCAMLCFLAGS=-thread
endif
FPIC=-fPIC
OCAMLC=ocamlc
OCAMLOPT=ocamlopt
OCAMLOPTFLAGS=-thread
OCAMLNETINCLUDES=$(shell ocamlfind query -r -i-format netstring) $(shell ocamlfind query -r -i-format netclient)
OCAMLNETCMA=$(shell ocamlfind query -r -a-format -predicates byte netstring) $(shell ocamlfind query -r -a-format -predicates byte netclient)
INCLUDES= $(shell ocamlfind query -r -i-format lablgtk2) -I ../../lib/ocaml $(shell ocamlfind query -r -i-format xml-light) $(shell ocamlfind query -r -i-format pcre) $(OCAMLNETINCLUDES)
LIBS=$(OCAMLNETCMA) glibivy-ocaml.cma lablgtk.cma lablglade.cma lib-pprz.cma lablgnomecanvas.cma xlib-pprz.cma
CMXA=$(LIBS:.cma=.cmxa)
ML= gtk_setting_time.ml gtk_strip.ml horizon.ml strip.ml gtk_save_settings.ml saveSettings.ml page_settings.ml pages.ml speech.ml plugin.ml sectors.ml map2d.ml editFP.ml live.ml particules.ml papgets.ml gcs.ml
MAIN=gcs
CMO=$(ML:.ml=.cmo)
CMX=$(ML:.ml=.cmx)
all : $(MAIN)
opt : $(MAIN).opt
$(MAIN) : $(CMO) ../../lib/ocaml/xlib-pprz.cma ../../lib/ocaml/lib-pprz.cma
@echo OL $@
$(Q)$(OCAMLC) $(OCAMLCFLAGS) -custom $(INCLUDES) $(OCAMLNETINCLUDES) unix.cma str.cma netstring.cma netclient.cma xml-light.cma $(LIBS) threads.cma gtkThread.cmo myGtkInit.cmo $(CMO) -o $@
$(MAIN).opt : $(CMX)
@echo OOL $@
$(Q)$(OCAMLOPT) $(OCAMLCFLAGS) $(INCLUDES) str.cmxa unix.cmxa xml-light.cmxa $(LIBS:.cma=.cmxa) threads.cmxa gtkThread.cmx gtkInit.cmx $(CMX) -o $@
%.cmo: %.ml
@echo OC $<
$(Q)$(OCAMLC) $(OCAMLCFLAGS) $(INCLUDES) -c $<
%.cmi: %.mli
@echo OCI $<
$(Q)$(OCAMLC) $(OCAMLCFLAGS) $(INCLUDES) -c $<
%.cmx: %.ml
@echo OOC $<
$(Q)$(OCAMLOPT) $(OCAMLCFLAGS) $(INCLUDES) -c $<
saveSettings.cmo : gtk_save_settings.cmo
saveSettings.cmx: gtk_save_settings.cmx
gtk_strip.ml : gcs.glade
lablgladecc2 -root eventbox_strip -hide-default $< | grep -B 1000000 " end" > $@
gtk_setting_time.ml : gcs.glade
lablgladecc2 -root setting_time -hide-default $< | grep -B 1000000 " end" > $@
gtk_save_settings.ml : gcs.glade
lablgladecc2 -root save_settings -hide-default $< | grep -B 1000000 " end" > $@
strip.cmo : gtk_strip.cmo gtk_setting_time.cmo
compass : compass.ml
$(OCAMLC) -custom $(OCAMLCFLAGS) $(INCLUDES) unix.cma str.cma xml-light.cma $(LIBS) gtkInit.cmo $^ -o $@
clean:
rm -f *~* *.cm* *.o *.out *.opt map2d gcs .depend gtk_strip.ml gtk_setting_time.ml gtk_save_settings.ml
CC = gcc
CFLAGS=-g -O2 -Wall `pkg-config gtk+-2.0 --cflags` $(FPIC)
LDFLAGS=`pkg-config gtk+-2.0 --libs` -s -lglibivy
ant_track : ant_track.c
$(CC) $(CFLAGS) -g -o $@ $^ $(LDFLAGS)
ant_track_pmm : ant_track_pmm.c
$(CC) $(CFLAGS) -g -o $@ $^ $(LDFLAGS)
test_enose : test_enose.c sliding_plot.c
$(CC) $(CFLAGS) -g -o $@ $^ $(LDFLAGS) -lgtkdatabox
actuators : actuators.c
$(CC) $(CFLAGS) -g -o $@ $^ $(LDFLAGS)
#
# Dependencies
#
.depend: Makefile
ocamldep -I ../../lib/ocaml *.ml* > .depend
ifneq ($(MAKECMDGOALS),clean)
-include .depend
endif