Commit 690cf35d authored by ASN.1 Documenter's avatar ASN.1 Documenter
Browse files

use config.mk for local configuration

parent 24a0b4ca
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -8,3 +8,4 @@ data/v3/xer/
/bin/
*.user
.vc
config.mk
 No newline at end of file
+16 −13
Original line number Diff line number Diff line
-include config.mk

ifeq (,$(ATS)) 
 $(error ATS shall be defined)
@@ -8,12 +9,14 @@ ifeq (,$(TOPDIR))
endif

ifeq (,$(TTCN3_DIR))
 TTCN3_DIR := /cygdrive/c/Tools/Titan
 $(error TTCN3_DIR shall be defined in config.mk)
endif

#ifeq (,$(OPENSSL_DIR))
# OPENSSL_DIR := C:/Tools/OpenSSL/Win64
#endif
ifeq (Windows_NT,$(OS))
ifeq (,$(OPENSSL_DIR))
 $(error OPENSSL_DIR shall be defined in config.mk)
endif
endif

define IncludeModule
undefine sources
@@ -26,8 +29,8 @@ $$(foreach M, $$(modules), $$(eval $$(call IncludeModule, $(1)/$$(M))))
endef

all_includes := $(TTCN3_DIR)/include $(TTCN3_DIR)/src $(TOPDIR)/ccsrc/Framework
defines  := TITAN_RUNTIME_2 _NO_SOFTLINKS_ $(ATS)
libs     := $(TTCN3_DIR)/lib/libttcn3-rt2-parallel.a -lstdc++fs
defines  += TITAN_RUNTIME_2 _NO_SOFTLINKS_ $(ATS)
libs     += $(TTCN3_DIR)/lib/libttcn3-rt2-parallel.a -lstdc++fs

ifeq (Windows_NT,$(OS))
# Silence linker warnings.
@@ -35,7 +38,7 @@ LDFLAGS += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc
defines += WIN32
libs += $(patsubst %, -L%/lib, $(OPENSSL_DIR))
all_includes += $(addsuffix /include, $(OPENSSL_DIR))
libs += /cygdrive/c/windows/system32/npcap/wpcap.dll
libs += $(WPCAP_DLL_PATH)
else
defines += LINUX
libs += -lpcap -lrt -lpthread
@@ -45,11 +48,11 @@ libs += -lssl -lcrypto -lxml2

$(eval $(call IncludeModule, $(TOPDIR)/ttcn/$(ATS)))

outdir := $(TOPDIR)/build
outdir := $(TOPDIR)/build/$(ATS)
bindir := $(TOPDIR)/bin

sources     := $(sort $(all_sources))
includes    := $(outdir) $(outdir)/asn1 $(all_includes) /cygdrive/c/PROGRA~1/Npcap/sdk/include
includes    := $(outdir) $(outdir)/../asn1 $(all_includes) $(NPCAP_INCLUDE)

EXE=.exe
ttcn_sources  := $(filter %.ttcn , $(sources))
@@ -101,7 +104,7 @@ force_regen:
$(outdir) $(bindir):
	mkdir -p $@

$(bindir)/$(ATS)$(EXE): $(outdir)/asn1/libItsAsn.a $(gen_objects) $(cc_objects) 
$(bindir)/$(ATS)$(EXE): $(outdir)/../asn1/libItsAsn.a $(gen_objects) $(cc_objects) 
	g++ -g -O0 -o $@ $(LDFLAGS) $(gen_objects) $(cc_objects) $(outdir)/asn1/libItsAsn.a $(libs)

$(gen_objects) :%.o :%.cc
@@ -123,9 +126,9 @@ $(outdir)/.generate-$(ATS): Makefile $(tt_sources)
$(bindir)/libItsAsn.so: $(outdir)/asn1/libItsAsn.so
	cp -f $< $@

$(outdir)/asn1/libItsAsn.a: FORCE
	mkdir -p $(outdir)/asn1
	$(MAKE) -C $(outdir)/asn1 -f ../../asn1/Makefile
$(outdir)/../asn1/libItsAsn.a: FORCE
	mkdir -p $(outdir)/../asn1
	$(MAKE) -C $(outdir)/../asn1 -f ../../asn1/Makefile

$(foreach S, $(ttcn_sources),  $(eval $(outdir)/$(notdir $(patsubst %.ttcn, %.cc,  $(S))): $(S)))
$(foreach S, $(ttcn3_sources), $(eval $(outdir)/$(notdir $(patsubst %.ttcn3, %.cc, $(S))): $(S)))

config.mk

0 → 100755
+3 −0
Original line number Diff line number Diff line
TTCN3_DIR      := /cygdrive/c/Tools/Titan
WPCAP_DLL_PATH := /cygdrive/c/windows/system32/npcap/wpcap.dll
NPCAP_INCLUDE  := /cygdrive/c/PROGRA~1/Npcap/sdk/include
 No newline at end of file