Home | History | Annotate | Download | only in manual_tests
      1 #
      2 # Copyright (C) 2017 The Android Open Source Project
      3 #
      4 # Licensed under the Apache License, Version 2.0 (the "License");
      5 # you may not use this file except in compliance with the License.
      6 # You may obtain a copy of the License at
      7 #
      8 #      http://www.apache.org/licenses/LICENSE-2.0
      9 #
     10 # Unless required by applicable law or agreed to in writing, software
     11 # distributed under the License is distributed on an "AS IS" BASIS,
     12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 # See the License for the specific language governing permissions and
     14 # limitations under the License.
     15 #
     16 #
     17 # This lets us build simple apps that talk to a Citadel dev board.
     18 #
     19 
     20 PROGS = test_citadel
     21 
     22 # Assumes a full Nugget OS source tree
     23 NOS_ROOT = $(realpath ../../..)
     24 HOST_GENERIC = $(NOS_ROOT)/host/generic
     25 HOST_LINUX = $(NOS_ROOT)/host/linux
     26 MPSSE = $(NOS_ROOT)/core/nugget/util/libmpsse/src
     27 
     28 INCDIRS = . \
     29 	$(HOST_GENERIC)/nugget/include \
     30 	$(HOST_GENERIC)/libnos_datagram/include \
     31 	$(HOST_GENERIC)/libnos_transport/include \
     32 	$(MPSSE)
     33 
     34 EXT_SRCS = \
     35 	$(HOST_LINUX)/citadel/libnos_datagram/citadel.c \
     36 	$(HOST_GENERIC)/libnos_transport/transport.c \
     37 	$(MPSSE)/mpsse.c \
     38 	$(MPSSE)/support.c
     39 
     40 ifneq ($(DEBUG),)
     41 CFLAGS += -DDEBUG=$(DEBUG)
     42 endif
     43 CFLAGS += -Wall -Werror
     44 CFLAGS += $(foreach I,$(INCDIRS),-I$(I))
     45 
     46 CFLAGS += $(shell pkg-config --cflags libftdi libcrypto)
     47 LDFLAGS += $(shell pkg-config --libs libftdi libcrypto)
     48 
     49 % : %.c $(EXT_SRCS)
     50 	$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@
     51 
     52 .PHONY: all
     53 all: $(PROGS)
     54 
     55 .PHONY: clean
     56 clean:
     57 	rm -f $(PROGS)
     58