diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 46 |
1 files changed, 46 insertions, 0 deletions
@@ -1,5 +1,8 @@ PROJECTNAME=minicc +VERSION=$(shell dpkg-parsechangelog --show-field Version) +DISTROS=base #debian10 ubuntu2004 ubuntu2010 + CXX=clang++-11 #CXX=g++-10 @@ -9,6 +12,8 @@ CXXFLAGS=-O2 -DNDEBUG # gcc:--coverage CXXFLAGS+= -Wall -I. -std=c++20 +CXXFLAGS+= -fPIE -DVERSION=\"$(VERSION)\" + ifeq ($(CXX),clang++-11) CXXFLAGS+=-stdlib=libc++ @@ -114,6 +119,10 @@ test: unittest systemtest check: test +install: + mkdir -p $(DESTDIR)/usr/bin + cp mcc $(DESTDIR)/usr/bin + # Tests on C++ level unittest: test-$(PROJECTNAME) ./test-$(PROJECTNAME) #--gtest_filter='CppTest.compile_parentheses_right' @@ -145,6 +154,43 @@ googletest/src/%.o: googletest/src/%.cc ADD_DEP=Makefile # misc --------------------------------------------------- +deb: + # build binary deb package + dpkg-buildpackage -rfakeroot + +deb-src: + dh_clean + dh_auto_clean + dpkg-source -b -I.git -Iresult . + +$(DISTROS): deb-src + sudo pbuilder build --basetgz /var/cache/pbuilder/$@.tgz --buildresult result/$@ ../$(PROJECTNAME)_$(VERSION).dsc + debsign result/$@/$(PROJECTNAME)_$(VERSION)_amd64.changes + +debs: $(DISTROS) + +DISTFILES= \ + $(TESTSRC) \ + $(PROGSRC:.cpp=.h) \ + debian/control \ + debian/compat \ + debian/copyright \ + debian/source \ + debian/source/format \ + debian/changelog \ + debian/README.Debian \ + debian/rules \ + README \ + TODO + +dist: clean + rm -rf $(PROJECTNAME)-$(VERSION) + mkdir $(PROJECTNAME)-$(VERSION) + cp --parents -r $(DISTFILES) $(PROJECTNAME)-$(VERSION) + tar cfJ ../$(PROJECTNAME)-$(VERSION).tar.xz $(PROJECTNAME)-$(VERSION) + rm -rf $(PROJECTNAME)-$(VERSION) + ls -l ../$(PROJECTNAME)-$(VERSION).tar.xz + clean: -rm -f test-$(PROJECTNAME) mcc tempfile.txt -find . -name '*.o' -o -name '*.d' -o -name '*.gcno' -o -name '*.gcda' | xargs rm -f |