Skip to content

Commit

Permalink
Merge pull request toroidal-code#1 from toroidal-code/librarize
Browse files Browse the repository at this point in the history
Done with Library-izing
  • Loading branch information
toroidal-code committed Feb 3, 2014
2 parents d716bb5 + ad426ff commit d2e4a18
Show file tree
Hide file tree
Showing 31 changed files with 1,697 additions and 430 deletions.
5 changes: 0 additions & 5 deletions DMX Timing

This file was deleted.

45 changes: 17 additions & 28 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,19 @@
# The top level targets link in the two .o files for now.
#
TARGETS += examples/rgb-test
TARGETS += examples/fade-test
TARGETS += examples/fire
TARGETS += udp-rx
TARGETS += opc-rx
TARGETS += examples/matrix-test
TARGETS += examples/tile-test
TARGETS += examples/scroll
# TARGETS += examples/fade-test
# TARGETS += examples/fire
# TARGETS += network/udp-rx
# TARGETS += network/opc-rx

LEDSCAPE_OBJS = ledscape.o pru.o util.o
LEDSCAPE_LIB := libledscape.a
PIXELBONE_OBJS = pixel.o gfx.o matrix.o pru.o util.o
PIXELBONE_LIB := libpixelbone.a

all: $(TARGETS) ws281x.bin


ifeq ($(shell uname -m),armv7l)
# We are on the BeagleBone Black itself;
# do not cross compile.
export CROSS_COMPILE:=
else
# We are not on the BeagleBone and might be cross compiling.
# If the environment does not set CROSS_COMPILE, set our
# own. Install a cross compiler with something like:
#
# sudo apt-get install gcc-arm-linux-gnueabi
#
export CROSS_COMPILE?=arm-linux-gnueabi-
endif

CFLAGS += \
-std=c99 \
-W \
Expand All @@ -45,10 +33,7 @@ LDFLAGS += \
LDLIBS += \
-lpthread \

COMPILE.o = $(CROSS_COMPILE)gcc $(CFLAGS) -c -o $@ $<
COMPILE.a = $(CROSS_COMPILE)gcc -c -o $@ $<
COMPILE.link = $(CROSS_COMPILE)gcc $(LDFLAGS) -o $@ $^ $(LDLIBS)

export CROSS_COMPILE:=

#####
#
Expand Down Expand Up @@ -76,13 +61,17 @@ PASM := $(PASM_DIR)/pasm
$(PASM) -V3 -b $<.i $(basename $@)
$(RM) $<.i

%.o: %.cpp
$(CXX) -std=c++11 -c -o $@ $<

%.o: %.c
$(COMPILE.o)
$(CC) $(CFLAGS) -c -o $@ $<


$(foreach O,$(TARGETS),$(eval $O: $O.o $(LEDSCAPE_OBJS) $(APP_LOADER_LIB)))
$(foreach O,$(TARGETS),$(eval $O: $O.o $(PIXELBONE_OBJS) $(APP_LOADER_LIB)))

$(TARGETS):
$(COMPILE.link)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)


.PHONY: clean
Expand Down
Loading

0 comments on commit d2e4a18

Please sign in to comment.