Makefile 1.25 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

#INSTDIR   = $(prefix)/usr/local/bin/
CGIDIR    = /www/pages
BINDIR    = /usr/bin/
INSTMODE  = 0755
INSTOWNER = root
INSTGROUP = root

PROGS     = editconf.cgi unescape strconf.cgi
SRCS = editconf.c unescape.c strconf.cpp
OBJS = editconf.o unescape.o

OBJS += $(SOURCES:.cpp=.o) 

CFLAGS   += -Wall -I$(STAGING_DIR_HOST)/usr/include-uapi
 
all: $(PROGS)

strconf.cgi: strconf.o
	$(CXX) $(LDFLAGS) $^ $(LDLIBS) -o $@
editconf.cgi: editconf.o
	$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
unescape: unescape.o
	$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@

install:	$(PROGS)
	$(INSTALL) $(OWN) -d $(DESTDIR)
	$(INSTALL) $(OWN) -d $(DESTDIR)$(CGIDIR)
	$(INSTALL) $(OWN) -d $(DESTDIR)$(BINDIR)
	$(INSTALL) -m $(INSTMODE) -o $(INSTOWNER) -g $(INSTGROUP) strconf.cgi  $(DESTDIR)$(CGIDIR)
	$(INSTALL) -m $(INSTMODE) -o $(INSTOWNER) -g $(INSTGROUP) editconf.cgi $(DESTDIR)$(CGIDIR)
	$(INSTALL) -m $(INSTMODE) -o $(INSTOWNER) -g $(INSTGROUP) unescape     $(DESTDIR)$(BINDIR)
	$(INSTALL) -m $(INSTMODE) -o $(INSTOWNER) -g $(INSTGROUP) xmlxmt.cgi   $(DESTDIR)$(CGIDIR)
	$(INSTALL) -m $(INSTMODE) -o $(INSTOWNER) -g $(INSTGROUP) editconf.php $(DESTDIR)$(CGIDIR)
clean:
36
	rm -rf $(PROGS) *.o core .depend
Andrey Filippov's avatar
Andrey Filippov committed
37 38 39 40 41 42 43
depend: .depend

.depend: $(SRCS)
	rm -f ./.depend
	$(CC) $(CFLAGS) -MM $^ > ./.depend;

include .depend