fblib/Makefile

72 lines
1.8 KiB
Makefile
Raw Normal View History

2017-03-06 23:51:05 +08:00
#----------------------------------------------------------------------
# Makefile for the main svgalib source.
#----------------------------------------------------------------------
# *** NO SERVICIBLE PARTS HERE!
# All options are in Makefile.cfg.
2017-03-07 23:26:26 +08:00
#include ../Makefile.cfg
2017-03-06 23:51:05 +08:00
2017-03-07 23:26:26 +08:00
srcdir = $(shell sh -c pwd)
prefix = /export/imx6/rootfs/rootfs-mx6g2c-new-nand/usr/local/test
#VPATH = $(srcdir)/src
2017-03-06 23:51:05 +08:00
#----------------------------------------------------------------------
# Compiler Section (overrides Makefile.cfg)
#----------------------------------------------------------------------
2017-03-07 23:26:26 +08:00
INCLUDES = -I$(srcdir)/gl/ -I$(srcdir)/test/
CFLAGS =
2017-03-06 23:51:05 +08:00
2017-03-07 23:26:26 +08:00
CC = arm-linux-gnueabihf-gcc
2017-03-06 23:51:05 +08:00
#----------------------------------------------------------------------
# Rules Section
#----------------------------------------------------------------------
2017-03-07 23:26:26 +08:00
fblib = gl/fbtool.o gl/point.o # line.o rectangle.o circle.o
2017-03-06 23:51:05 +08:00
2017-03-07 23:26:26 +08:00
testfb = /test/test.o
2017-03-06 23:51:05 +08:00
2017-03-07 23:26:26 +08:00
ALLOBJS = $(fblib) $(testfb)
frist:clean test
2017-03-06 23:51:05 +08:00
.c.o:
$(CC) $(CFLAGS) -c -o $*.o $<
2017-03-07 23:26:26 +08:00
.PHONY: all dep clean install
2017-03-06 23:51:05 +08:00
2017-03-07 23:26:26 +08:00
test: $(ALLOBJS)
$(CC) $(ALLOBJS) -o test_fb7 -lm
2017-03-06 23:51:05 +08:00
2017-03-07 23:26:26 +08:00
$(ALLOBJS): .depend
2017-03-06 23:51:05 +08:00
dep:
2017-03-07 23:26:26 +08:00
rm -f .depend
make .depend
2017-03-06 23:51:05 +08:00
2017-03-07 23:26:26 +08:00
.depend:
echo '# fblib dependencies' >>.depend.gl
$(CC) $(INCLUDES) -MM $(patsubst %.o,$(srcdir)/gl/%.c,$(fblib)) >>.depend.gl
sed 's#^\(.*\.o\):#gl/\1:#g' <.depend.gl >>.depend
rm -f .depend.gl
echo '# test dependencies' >>.depend.test
$(CC) $(INCLUDES) -MM $(patsubst %.o,$(srcdir)/src/%.c,$(testfb)) >.depend.test
sed 's#^\(.*\.o\):#test/\1:#g' <.depend.test >>.depend
rm -f .depend.test
2017-03-06 23:51:05 +08:00
2017-03-07 23:26:26 +08:00
clean:
@rm -fv gl/*.o gl/*.gch test/*.o test/*.gch test/test_fb7
install: clean test
@cp -vf $(srcdir)/test/test_fb7 $(prefix)
@chmod 777 $(prefix)/test_fb7
2017-03-06 23:51:05 +08:00
FORCE: # dummy target.
#
# include a dependency file if one exists
#
2017-03-07 23:26:26 +08:00
ifeq (.depend,$(wildcard .depend))
include .depend
2017-03-06 23:51:05 +08:00
endif