Skip to content

Commit

Permalink
[enhancement] cleaning of SDK integration and makefiles syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
PThierry committed Apr 17, 2019
1 parent 87f98a1 commit dd299f4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 18 deletions.
34 changes: 22 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
###################################################################
# About the library name and path
###################################################################

# library name, without extension
LIB_NAME ?= libiso7816

# project root directory, relative to app dir
PROJ_FILES = ../../
LIB_FULL_NAME = $(LIB_NAME).a

VERSION = 1
#############################
# library name, with extension
LIB_FULL_NAME = $(LIB_NAME).a

# SDK helper Makefiles inclusion
-include $(PROJ_FILES)/Makefile.conf
-include $(PROJ_FILES)/Makefile.gen

# use an app-specific build dir
APP_BUILD_DIR = $(BUILD_DIR)/libs/$(LIB_NAME)

CFLAGS += $(LIBS_CFLAGS)
CFLAGS += -ffreestanding
CFLAGS += $(DRIVERS_CFLAGS)
CFLAGS += -I$(PROJ_FILES)/include/generated -I$(PROJ_FILES) -I$(PROJ_FILES)/libs/std -I$(PROJ_FILES)/kernel/shared -I.
# dependency on lower iso7816 interface
CFLAGS += -MMD -MP
###################################################################
# About the compilation flags
###################################################################

LDFLAGS += -fno-builtin -nostdlib -nostartfiles
LD_LIBS += -lg
CFLAGS := $(LIBS_CFLAGS)
CFLAGS += -MMD -MP

BUILD_DIR ?= $(PROJ_FILE)build
#############################################################
# About library sources
#############################################################

SRC_DIR = .
SRC = $(wildcard $(SRC_DIR)/*.c)
Expand All @@ -37,6 +42,11 @@ TODEL_CLEAN += $(OBJ)
# targets
TODEL_DISTCLEAN += $(APP_BUILD_DIR)

##########################################################
# generic targets of all libraries makefiles
##########################################################


.PHONY: app doc

default: all
Expand Down
8 changes: 4 additions & 4 deletions smartcard_iso7816.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "api/stdio.h"
#include "api/nostd.h"
#include "api/string.h"
#include "api/syscall.h"
#include "libc/stdio.h"
#include "libc/nostd.h"
#include "libc/string.h"
#include "libc/syscall.h"
#include "libdrviso7816.h"
#include "api/libiso7816.h"

Expand Down
4 changes: 2 additions & 2 deletions smartcard_print.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define __SMARTCARD_PRINT_H__

#include "autoconf.h"
#include "api/stdio.h"
#include "api/nostd.h"
#include "libc/stdio.h"
#include "libc/nostd.h"

#define SMARTCARD_DEBUG CONFIG_SMARTCARD_DEBUG
#define MEASURE_TOKEN_PERF
Expand Down

0 comments on commit dd299f4

Please sign in to comment.