diff options
author | Mattias Andrée <maandree@kth.se> | 2024-01-09 22:04:24 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2024-01-09 22:04:24 +0100 |
commit | ae850b1ac755f471beac4dbfef4654fe3fbaaae9 (patch) | |
tree | 319e7f7f1b99cd1ee75e100f0a29b0f7c827ccea /Makefile | |
download | libpatch-ae850b1ac755f471beac4dbfef4654fe3fbaaae9.tar.gz libpatch-ae850b1ac755f471beac4dbfef4654fe3fbaaae9.tar.bz2 libpatch-ae850b1ac755f471beac4dbfef4654fe3fbaaae9.tar.xz |
First commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..38d51dc --- /dev/null +++ b/Makefile @@ -0,0 +1,111 @@ +.POSIX: + +CONFIGFILE = config.mk +include $(CONFIGFILE) + +OS = linux +# Linux: linux +# Mac OS: macos +# Windows: windows +include mk/$(OS).mk + + +LIB_MAJOR = 1 +LIB_MINOR = 0 +LIB_VERSION = $(LIB_MAJOR).$(LIB_MINOR) +LIB_NAME = patch + + +OBJ =\ + libpatch_append_to_patch__.o\ + libpatch_check_file.o\ + libpatch_create_timestamp.o\ + libpatch_create_timestamp_fd.o\ + libpatch_create_timestamp_frac_string.o\ + libpatch_create_timestamp_secs.o\ + libpatch_create_timestamp_stat.o\ + libpatch_create_timestamp_tm.o\ + libpatch_create_timestamp_ts.o\ + libpatch_create_timestamp_tv.o\ + libpatch_create_timestamp_now.o\ + libpatch_fd_diff2_printer__.o\ + libpatch_format_copied_patch.o\ + libpatch_format_ed_alternative_patch.o\ + libpatch_format_ed_patch.o\ + libpatch_format_normal_patch.o\ + libpatch_format_patch.o\ + libpatch_format_rcs_patch.o\ + libpatch_format_unified_patch.o\ + libpatch_get_label_format.o\ + libpatch_get_zu__.o\ + libpatch_guess_format.o\ + libpatch_is_devnull.o\ + libpatch_next_hunk.o\ + libpatch_next_line__.o\ + libpatch_parse_copied_patch.o\ + libpatch_parse_ed_patch.o\ + libpatch_parse_normal_patch.o\ + libpatch_parse_patch.o\ + libpatch_parse_rcs_patch.o\ + libpatch_parse_timestamp.o\ + libpatch_parse_unified_patch.o\ + libpatch_plain_diff2_printer__.o\ + libpatch_plain_fd_diff2_printer.o\ + libpatch_plain_stream_diff2_printer.o\ + libpatch_previous_hunk.o\ + libpatch_reverse_diff2.o\ + libpatch_reverse_hunks__.o\ + libpatch_rewrite_diff2.o\ + libpatch_stream_diff2_printer__.o\ + libpatch_style_requires_text.o + +HDR =\ + libpatch.h\ + common.h + +LOBJ = $(OBJ:.o=.lo) + + +all: libpatch.a libpatch.$(LIBEXT) +$(OBJ): $(HDR) +$(LOBJ): $(HDR) + +.c.o: + $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS) + +.c.lo: + $(CC) -fPIC -c -o $@ $< $(CFLAGS) $(CPPFLAGS) + +libpatch.a: $(OBJ) + @rm -f -- $@ + $(AR) rc $@ $(OBJ) + $(AR) ts $@ > /dev/null + +libpatch.$(LIBEXT): $(LOBJ) + $(CC) $(LIBFLAGS) -o $@ $(LOBJ) $(LDFLAGS) + +install: libpatch.a libpatch.$(LIBEXT) + mkdir -p -- "$(DESTDIR)$(PREFIX)/lib" + mkdir -p -- "$(DESTDIR)$(PREFIX)/include" + cp -- libpatch.a "$(DESTDIR)$(PREFIX)/lib/" + cp -- libpatch.$(LIBEXT) "$(DESTDIR)$(PREFIX)/lib/libpatch.$(LIBMINOREXT)" + $(FIX_INSTALL_NAME) "$(DESTDIR)$(PREFIX)/lib/libpatch.$(LIBMINOREXT)" + ln -sf -- libpatch.$(LIBMINOREXT) "$(DESTDIR)$(PREFIX)/lib/libpatch.$(LIBMAJOREXT)" + ln -sf -- libpatch.$(LIBMAJOREXT) "$(DESTDIR)$(PREFIX)/lib/libpatch.$(LIBEXT)" + cp -- libpatch.h "$(DESTDIR)$(PREFIX)/include/" + +uninstall: + -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libpatch.a" + -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libpatch.$(LIBMAJOREXT)" + -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libpatch.$(LIBMINOREXT)" + -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libpatch.$(LIBEXT)" + -rm -f -- "$(DESTDIR)$(PREFIX)/include/libpatch.h" + +clean: + -rm -f -- *.o *.a *.lo *.su *.so *.so.* *.dll *.dylib + -rm -f -- *.gch *.gcov *.gcno *.gcda *.$(LIBEXT) + +.SUFFIXES: +.SUFFIXES: .lo .o .c + +.PHONY: all install uninstall clean |