From: DeaDDooMER Date: Sat, 18 Aug 2018 10:16:54 +0000 (+0300) Subject: Fix if(x=y). Added CC variable to makefile. X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=da59d5524abbb95fb4112248dea75396cd00ff6d;p=odcread.git Fix if(x=y). Added CC variable to makefile. --- diff --git a/Makefile b/Makefile index 3e394f0..0dbb36a 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,8 @@ # * $(MODULE)/*.cc -- module source files MODULES := main reader store alien typeregister textmodel fold typepath -CFLAGS += -I. +CFLAGS = -I. +CC = g++ # Variables for the modules to write to SRCS := @@ -16,11 +17,11 @@ include $(patsubst %,%/Make.inc,$(MODULES)) # This rule just links the object files together odcread: $(SRCS:.cc=.o) - g++ -o $@ $^ + $(CC) -o $@ $^ # This rule build an object (.o) from a source (.cc). %.o: %.cc - g++ $(CFLAGS) $< -c -o $@ + $(CC) $(CFLAGS) $< -c -o $@ # For each implementation header (.ih) generate a dependency (.d) file which # will ensure that the compiled header (.ih.gch) is rebuilt whenever the header @@ -33,8 +34,8 @@ odcread: $(SRCS:.cc=.o) # The .d file is not an explicit target because it will need to be (re-)built # if and only if the .ih.gch needs to be rebuilt. %.ih.gch: %.ih - g++ $(CFLAGS) -x c++-header $< -MM -MF $*.d -MP -MT $@ - g++ $(CFLAGS) -x c++-header $< -o $@ + $(CC) $(CFLAGS) -x c++-header $< -MM -MF $*.d -MP -MT $@ + $(CC) $(CFLAGS) -x c++-header $< -o $@ # Each module has a .ih file that should be *the only* include from the .cc # files. These .ih files are pre-compiled to .ih.gch, and dependency caching diff --git a/main/odcread.cc b/main/odcread.cc index e6e1748..a2a2bd5 100644 --- a/main/odcread.cc +++ b/main/odcread.cc @@ -155,7 +155,7 @@ int main(int argc, char *argv[]) { try { if (argc < 2) { s = odc::importDocument(std::cin); - } else if (argc = 2) { + } else if (argc == 2) { std::ifstream in(argv[1], std::ios::in | std::ios::binary); s = odc::importDocument(in); } else {