Makefile 1.58 KB
Newer Older
1
#TODO: pass $(LN) from bitbake
2 3
LN = ln
WWW_PAGES = /www/pages/
Andrey Filippov's avatar
Andrey Filippov committed
4
BINDIR    = /usr/bin/
5 6
VARHTML   = /var/volatile/html/
CONFDIR   = /etc/elphel393/
Andrey Filippov's avatar
Andrey Filippov committed
7 8 9 10 11
INSTMODE  = 0755
INSTDOCS =  0644
INSTOWNER = root
INSTGROUP = root

12 13 14
PROGS     = nmea2exif log_imu garminusb2nmea garminusb2exif
SRCS =      nmeagen.c exifgen.c garminusb2nmea.c garminusb2exif.c nmea2exif.c log_imu.c
OBJS =      nmeagen.o exifgen.o garminusb2nmea.o garminusb2exif.o nmea2exif.o
15
PHPSCRIPTS= start_gps_compass.php start_ims.php
16
PHPWEB=     logger_launcher.php imu_setup.php read_imu_log.php
Andrey Filippov's avatar
Andrey Filippov committed
17 18 19

CFLAGS   += -Wall -I$(STAGING_DIR_HOST)/usr/include-uapi
LDLIBS   += -lm
20

Andrey Filippov's avatar
Andrey Filippov committed
21 22 23 24 25 26 27 28
all: $(PROGS)

log_imu: log_imu.o
	$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@

nmea2exif: nmea2exif.o
	$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@

29 30 31 32 33 34
garminusb2nmea: garminusb2nmea.o nmeagen.o
	$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@

garminusb2exif: garminusb2exif.o exifgen.o
	$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@

Andrey Filippov's avatar
Andrey Filippov committed
35 36 37 38 39
install:	$(PROGS)
	$(INSTALL) $(OWN) -d $(DESTDIR)
	$(INSTALL) -d $(DESTDIR)$(BINDIR)
	$(INSTALL) -d $(DESTDIR)$(WWW_PAGES)
	$(INSTALL) -m $(INSTMODE) -o $(INSTOWNER) -g $(INSTGROUP) $(PROGS) $(DESTDIR)$(BINDIR)
40 41 42 43 44 45
	$(INSTALL) -m $(INSTMODE) -o $(INSTOWNER) -g $(INSTGROUP) $(PHPSCRIPTS) $(DESTDIR)$(BINDIR)
	$(INSTALL) -o $(INSTOWNER) -m $(INSTDOCS) $(PHPWEB)  $(DESTDIR)$(WWW_PAGES)
	$(INSTALL) $(OWN)-d $(DESTDIR)$(VARHTML)
	$(LN) -sf $(VARHTML) $(DESTDIR)$(WWW_PAGES)var
	$(INSTALL) $(OWN)-d $(DESTDIR)$(CONFDIR)
	$(LN) -sf $(CONFDIR) $(DESTDIR)$(WWW_PAGES)etc
46

Andrey Filippov's avatar
Andrey Filippov committed
47 48 49 50 51 52 53 54 55 56

clean:
	rm -rf $(PROGS) *.o *~
depend: .depend

.depend: $(SRCS)
	rm -f ./.depend
	$(CC) $(CFLAGS) -MM $^ > ./.depend;

include .depend